LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-18-2015, 11:13 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Interface to work with mySQL


Hi,
I have set up mySQL on Redhat. What is the interface to work with mySQL?
 
Old 05-18-2015, 11:18 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
What is the interface to work with mySQL?
the terminal or phpMyAdmin
 
Old 05-19-2015, 12:58 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Thanks. How to call the interface, within terminal?
 
Old 05-19-2015, 01:39 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Huamin View Post
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.
 
Old 05-19-2015, 02:21 AM   #5
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
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 ~]#
 
Old 05-19-2015, 02:26 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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.
 
1 members found this post helpful.
Old 05-19-2015, 03:38 AM   #7
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Thanks a lot.
BTW, how to resolve this?

mysql> create table t
-> (fld1 char(20))
-> ;
ERROR 1046 (3D000): No database selected
mysql>
 
Old 05-19-2015, 03:52 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Try creating a database first.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mediawiki - interface to MySQL on RHEL 5.4 thllgo Linux - Software 5 01-31-2012 05:48 PM
Need help. The classic error: can't get php5 to work with mysql. - - without-mysql retry Linux - Server 3 05-27-2008 06:38 PM
Not able to use mysql in graphical interface.. ramesh14 Linux - Networking 1 05-14-2008 05:02 PM
MySQL Interface rn5a Linux - Newbie 7 09-07-2007 06:13 AM
Deleted the mysql db files from /var/lib/mysql and reinstalling doesn't work! Frostblade Linux - Software 1 05-24-2006 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration