LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   MySql throwing connection error (https://www.linuxquestions.org/questions/linux-server-73/mysql-throwing-connection-error-606224/)

mystic_durle12 12-12-2007 02:27 AM

MySql throwing connection error
 
hi fellows, I installed Fedora Core 5 with MySql server but now when i type
mysql -u username -p password
on the command prompt, it gives the following error
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

can anyone help me out on this

kzutter 12-12-2007 07:02 PM

Can you log in as root with no password?

I am not Fedora guy, but I do not expect that the mysql server was setup with any users except root and possibly a system user for rpm updates.


Also look at /etc/my.conf (or wherever Fedora stores my.conf) and see if you need to setup allowed connections. Pay particular attention to the option 'Skip Networking'.

mystic_durle12 12-15-2007 06:22 PM

yesterday i had a major internet failure on my side. i would have replied yesterday. anyways its not working with root user too. Its giving the same error. and the /etc/my.conf u talk about is /etc/my.cnf on my system. i think its the same. I looks like this

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

tell me what do i need to do about it.

kzutter 12-15-2007 10:45 PM

That is quite a bit less than mine - but I have an idea...

Are you sure the mysql daemon (server) is running? If I shut mine down, I get EXACTLY the same error.

Code:

Stopping MySQL database server: mysqld.
ken@u2:~$ mysql -u ken -p********
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


mystic_durle12 12-17-2007 11:14 PM

can u plz tell me how to get server daemon up again.

chrism01 12-18-2007 12:23 AM

service mysqld start

mystic_durle12 12-18-2007 01:05 AM

its not working fellow. it says that sqld service not a command.

mystic_durle12 12-18-2007 01:05 AM

its not working fellow. it says that sqld service not a command.
tell me the exact command

chrism01 12-18-2007 01:12 AM

Please show exactly what cmd you typed and what the error msg was. Your answer is different to my example ....

mystic_durle12 12-18-2007 01:31 AM

i have tried both of them and this is the error message.

[root@localhost Tampa]# mysqld start
bash: mysqld: command not found

[root@localhost Tampa]# service mysqld start
bash: service: command not found

jschiwal 12-18-2007 01:39 AM

Look at the output of "sudo /sbin/chkconfig -l". Do you see an entry with mysql in the name?
How did you install the mysql server? Did you maybe just install the client and not the server?

Also, why did you install such an old Fedora Core version? The current is Fedora Core 8.

mystic_durle12 12-18-2007 01:52 AM

it has this line in it
mysqld 0 : off 1 : off 2 : off 3 : off 4 : off 5 : off 6 : off
its off for all run levels
how can i get it on again
and about the old version of FC. i have a slow dial up connection and i find it hard to download a new version of FC

mystic_durle12 12-18-2007 02:28 AM

should i simply turn it on. and is there a gui solution to it

chrism01 12-18-2007 06:48 PM

Yeah, it should be in the menus if it's installed. Unfortunately my FC box is at home and I'm at work (suse), so I can't remember the menu path.

kzutter 12-19-2007 10:18 AM

Here is the Fedora FAQ URL for starting services:
http://www.fedorafaq.org/basics/#startprogram


All times are GMT -5. The time now is 03:47 AM.