pacman Posted February 28, 2003 Share Posted February 28, 2003 I installed mysql and a groupware tool. Everything went fine until I tried to change some permissions to the database... My problem: The Groupware Tool is up and running fine - it\'s ok But I can\'t connect to mysql with another user or with the mysqladmin... Error message: [root@localhost mysql]# mysql ERROR 2002: Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (111) [root@localhost mysql]# Mysql is running: [root@localhost mysql]# ps -ef | grep mysql root 941 1 0 Feb20 ? 00:00:00 /bin/sh /usr/bin/safe_mysqld --d mysql 7391 941 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f mysql 7393 7391 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f mysql 7394 7393 0 Feb21 ? 00:00:01 /usr/libexec/mysqld --defaults-f mysql 7395 7393 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f root 17415 16950 0 17:12 pts/0 00:00:00 grep mysql and the .sock file exists: [root@localhost mysql]# ls -l /var/lib/mysql/mysql.sock -rwxrwxrwx 1 mysql mysql 0 Feb 27 16:34 /var/lib/mysql/mysql.sock [root@localhost mysql]# If I try to connect via PHPmyAdmin I get the message Server localhost Error MySQL said: MySQL Connection Failed: Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (111) Maybe I have to explain how this situation was coming up... I had the whole installation working with localhost permissons for access to mysql. I tried to change this via Webmin that I can access the DB from a Gui outside this host. I think I took all permissions from the super user (Don\'t know how :roll: ). Is it possible to rebuild the user table? Without affect to the running Groupware? Regards Frank Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/ Share on other sites More sharing options...
pallevillesen Posted February 28, 2003 Share Posted February 28, 2003 Run the mysql_install_db in the mysql/bin directory... It will reset the users table to the original, with the root user having a blank password. You may then connect using mysql -h localhost -u root and add your own users etc. P. Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-543 Share on other sites More sharing options...
pacman Posted February 28, 2003 Author Share Posted February 28, 2003 Thanks for your answer. If I do that, is the new user which I have created for the Groupware affected? Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-545 Share on other sites More sharing options...
pacman Posted February 28, 2003 Author Share Posted February 28, 2003 Ok, I did it, but I still get the message: [root@localhost bin]# ./mysqladmin status ./mysqladmin: connect to server at \'localhost\' failed error: \'Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (111)\' Check that mysqld is running and that the socket: \'/var/lib/mysql/mysql.sock\' exists! [root@localhost bin]# BUT MySQL is running: [root@localhost bin]# ps -ef |grep mysql root 941 1 0 Feb20 ? 00:00:00 /bin/sh /usr/bin/safe_mysqld --d mysql 7391 941 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f mysql 7393 7391 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f mysql 7394 7393 0 Feb21 ? 00:00:01 /usr/libexec/mysqld --defaults-f mysql 7395 7393 0 Feb21 ? 00:00:00 /usr/libexec/mysqld --defaults-f root 18411 18342 0 10:16 pts/0 00:00:00 grep mysql [root@localhost bin]# Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-547 Share on other sites More sharing options...
pacman Posted February 28, 2003 Author Share Posted February 28, 2003 I did a reboot and now I don\'t have the socket failure anymore. PHPmyAdmin is also working, but I don\'t have and permissions. I only see the test database and I have no priviledge to change anything... Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-548 Share on other sites More sharing options...
pallevillesen Posted March 1, 2003 Share Posted March 1, 2003 Hi, try the following and then log into phpmyadmin using the biopv user (or your own username - probably a better idea ) It\'s probably just the grant tables that needs updating... P. Shell>mysql -h localhost -u root Welcome to the MySQL monitor. Commands end with; or g. Your MySQL connection id is 14 to server version: 3.23.52 Type \'help;\' or \'h\' for help. Type \'c\' to clear the buffer. mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> mysql> grant all privileges on *.* to biopv@"%" identified by \'biopv\' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> mysql> mysql> grant all privileges on *.* to biopv@localhost identified by \'biopv\' with grant option; Query OK, 0 rows affected (0.00 sec) Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-555 Share on other sites More sharing options...
pacman Posted March 3, 2003 Author Share Posted March 3, 2003 Hi, this is really help for dummies, thanks :-) But: [root@localhost /root]# mysql -h localhost -u root Welcome to the MySQL monitor. Commands end with; or g. Your MySQL connection id is 68 to server version: 3.23.36 Type \'help;\' or \'h\' for help. Type \'c\' to clear the buffer mysql> use mysql ERROR 1044: Access denied for user: \'@localhost\' to database \'mysql\' mysql> I think the user root doesn\'t exist? Frank Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-572 Share on other sites More sharing options...
pallevillesen Posted March 4, 2003 Share Posted March 4, 2003 Hmmm..... You ran the mysql_install_db program and something went wrong ? You should probably back up your data before continuing with anything. Just make a copy of the mysql/var/data or whereever they are stored... (You databases are put in a folder of their own with the database name as folder name). It looks like you could successfully login as root with a blank password, but you do not have permission to use the mysql database ? I\'m not sure if there is a clever solution (probably there is)... otherwise reinstall and then copy the databases you need back (don\'t restore the mysql database, since that\'s most likely what\'s causing the problem). My suggestion: Find the directory where you can see the folders named test mysql yourdb (whatever dbs you created). DELETE the mysql folder (i.e. the user tables, grant tables etc.) Run mysql_install_db again Check to see that a new folder has been generated, with new users etc... If this doesn\'t work - I\'m lost.... But as I said, BACKUP first! P. Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-584 Share on other sites More sharing options...
pacman Posted March 7, 2003 Author Share Posted March 7, 2003 Hi biopv, I have it done but I have the same result as above... Maybe I\'ll install the whole thing from scratch Frank Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-601 Share on other sites More sharing options...
mjz1 Posted October 10, 2003 Share Posted October 10, 2003 Hi there I am only a newbie so apologies if this is obvious, but I have seen a post that suggests checkingyour permissions on the mysql directory. If it is read only then this might be causing the error. Mike Quote Link to comment https://forums.phpfreaks.com/topic/188-cant-connect-to-mysql/#findComment-3876 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.