LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Interface to work with mySQL (https://www.linuxquestions.org/questions/linux-software-2/interface-to-work-with-mysql-4175542971/)

Huamin 05-18-2015 11:13 PM

Interface to work with mySQL
 
Hi,
I have set up mySQL on Redhat. What is the interface to work with mySQL?

John VV 05-18-2015 11:18 PM

Quote:

What is the interface to work with mySQL?
the terminal or phpMyAdmin

Huamin 05-19-2015 12:58 AM

Thanks. How to call the interface, within terminal?

TenTenths 05-19-2015 01:39 AM

Quote:

Originally Posted by Huamin (Post 5364332)
How to call the interface, within terminal?

Code:

mysql
or if you've defined a username or changed the root password:
Code:

mysql -u username -p
which will log you in as username and prompt you for the users password.

Huamin 05-19-2015 02:21 AM

Sorry, I've got these
[huamin@CentOS65x64 ~]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[huamin@CentOS65x64 ~]$ su -
Password:
[root@CentOS65x64 ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@CentOS65x64 ~]#

TenTenths 05-19-2015 02:26 AM

1) Ensure your MySQL server is actually running and try again.
2) If you are positive that MySQL is running then try
Code:

mysql -h localhost -P 3306
to force a TCP/IP connection.

Huamin 05-19-2015 03:38 AM

Thanks a lot.
BTW, how to resolve this?

mysql> create table t
-> (fld1 char(20))
-> ;
ERROR 1046 (3D000): No database selected
mysql>

TenTenths 05-19-2015 03:52 AM

Try creating a database first.


All times are GMT -5. The time now is 11:03 PM.