Re: MySQL ERROR 2002 (HY000): Can't connect to local...
Could be interesting:
Code:
arthur@localhost:~$ sudo tail /var/log/syslog
May 28 01:13:24 localhost mysqld[13982]: 080528 1:13:24 InnoDB: Started; log sequence number 0 63353
May 28 01:13:24 localhost mysqld[13982]: 080528 1:13:24 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'user'
May 28 01:13:24 localhost mysqld_safe[13993]: ended
May 28 01:13:39 localhost /etc/init.d/mysql[14143]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
May 28 01:13:39 localhost /etc/init.d/mysql[14143]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
May 28 01:13:39 localhost /etc/init.d/mysql[14143]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
May 28 01:13:39 localhost /etc/init.d/mysql[14143]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
May 28 01:13:39 localhost /etc/init.d/mysql[14143]:
May 28 01:17:01 localhost /USR/SBIN/CRON[14202]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 28 01:20:01 localhost /USR/SBIN/CRON[14256]: (www-data) CMD ([ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null)
arthur@localhost:~$
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
I just updated my 7.10 system to 8.04 just yesterday, and my MySQL server is running like a charm. I recall being asked the same question as you concerning the configuration file. I accepted the replacement, since I recall that the changes I made to the original config file had no effect on what I was attempting to do at the time.
Anyhow, I can't begin to imagine what happened to your system. I would suggest that you try to remove MySQL from your system, and then reattempt to install it.
Once MySQL is reinstalled, it should automatically start and be setup to run each time you reboot.
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
I am having many of the same issues as described here.
I have removed, cleaned, and purged mysql-server, mysql-server-5.0 and mysql-common so many times in the last few days.
I cannot even isolate what happened to kill it in the first place.
If i try and reinstall mysql-server-5.0, the base database does not even get created. MYSQL wont use the default pid and sock file locations.
If i edit my my.cnf file and change the pid and sock file locations to /tmp/mysqld.pid and /tmp/mysqld.sock and change my data file location to anywhere other than the /var/lib/mysql, then i can get mysql to start, but its still unusable.
I cannot get any databases to function from there.
This is getting really annoying.
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
Quote:
Originally Posted by
auskento
I am having many of the same issues as described here.
I have removed, cleaned, and purged mysql-server, mysql-server-5.0 and mysql-common so many times in the last few days.
I cannot even isolate what happened to kill it in the first place.
If i try and reinstall mysql-server-5.0, the base database does not even get created. MYSQL wont use the default pid and sock file locations.
If i edit my my.cnf file and change the pid and sock file locations to /tmp/mysqld.pid and /tmp/mysqld.sock and change my data file location to anywhere other than the /var/lib/mysql, then i can get mysql to start, but its still unusable.
I cannot get any databases to function from there.
This is getting really annoying.
I read you. I've just done a mysql reinstall and I can't get it to work on startup :(
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
Due to time constraints I decided to do a reinstall.
It wasn't that bigger of an issue since all the data I was messing around with was test data, I was just wondering what you would do in a commercial enviroment since starting from scratch is not an option
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
Removing and even purging mysql-server, will not remove the databases. I'm not sure if these symptoms were due to corrupt databases or otherwise, but for a really clean reinstall of mysql-server, one should also remove /var/lib/mysql/ where the database-files are stored.
This will remove configuration files and databases, so don't use it if you don't mean it:
Code:
sudo aptitude purge mysql-server
sudo mv /var/lib/mysql /var/lib/mysql.backup
sudo aptitude install mysql-server
# If you are confident that you don't need the old databases around:
# rm -rf /var/lib/mysql.backup/
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
sorry to bring up an old topic but I am completely at a loss.
Not sure why, but mysql stopped working one day. i would check and see that the service is running but no response. I kept getting the error in title of this posting.
So I tried to uninstall and re-install mysql. I've pasted the results of both actions below and you can see the errors. I have no idea how to get rid of it all and start all over.
removing mysql-server:
Code:
root@mike:/home/mike# sudo aptitude purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages are unused and will be REMOVED:
mysql-server-5.0
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 85.4MB will be freed.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
dpkg: error processing mysql-server-5.0 (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
trying to re-install
Code:
root@mike:/home/mike# sudo aptitude install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages are BROKEN:
mysql-server-5.0
The following NEW packages will be installed:
mysql-server
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/27.4MB of archives. After unpacking 90.1kB will be used.
The following packages have unmet dependencies:
mysql-server-5.0: Depends: libdbi-perl but it is not installable
Depends: mysql-client-5.0 (>= 5.0.51a-3ubuntu5.1) but it is not installable
Resolving dependencies...
The following actions will resolve these dependencies:
Install the following packages:
libdbd-mysql-perl [4.005-1 (hardy)]
libdbi-perl [1.601-1 (hardy)]
libnet-daemon-perl [0.38-1.1 (hardy)]
libplrpc-perl [0.2017-1.1 (hardy)]
libterm-readkey-perl [2.30-3ubuntu1 (hardy)]
mysql-client-5.0 [5.0.51a-3ubuntu5 (hardy)]
Downgrade the following packages:
mysql-server-5.0 [5.0.51a-3ubuntu5.1 (hardy-updates, now) -> 5.0.51a-3ubuntu5
(hardy)]
Score is -56
Accept this solution? [Y/n/q/?] Y
The following NEW packages will be automatically installed:
libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl
libterm-readkey-perl mysql-client-5.0
The following packages will be DOWNGRADED:
mysql-server-5.0
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl
libterm-readkey-perl mysql-client-5.0 mysql-server
0 packages upgraded, 7 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 36.2MB/36.3MB of archives. After unpacking 21.0MB will be used.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Get:1 http://dell-mini.archive.canonical.com hardy/main libnet-daemon-perl 0.38-1.1 [45.9kB]
Get:2 http://dell-mini.archive.canonical.com hardy/main libplrpc-perl 0.2017-1.1 [35.0kB]
Get:3 http://dell-mini.archive.canonical.com hardy/main libdbi-perl 1.601-1 [771kB]
Get:4 http://dell-mini.archive.canonical.com hardy/main libdbd-mysql-perl 4.005-1 [135kB]
Get:5 http://dell-mini.archive.canonical.com hardy/main mysql-server-5.0 5.0.51a-3ubuntu5 [27.4MB]
Get:6 http://dell-mini.archive.canonical.com hardy/main mysql-client-5.0 5.0.51a-3ubuntu5 [7835kB]
Get:7 http://dell-mini.archive.canonical.com hardy/main libterm-readkey-perl 2.30-3ubuntu1 [32.8kB]
Fetched 36.2MB in 10min39s (56.6kB/s)
Preconfiguring packages ...
Selecting previously deselected package libnet-daemon-perl.
(Reading database ... 99882 files and directories currently installed.)
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.601-1_lpia.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.005-1_lpia.deb) ...
Selecting previously deselected package mysql-server-5.0.
Preparing to replace mysql-server-5.0 5.0.51a-3ubuntu5.1 (using .../mysql-server-5.0_5.0.51a-3ubuntu5_lpia.deb) ...
/etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
/etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.0_5.0.51a-3ubuntu5_lpia.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
/etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
df: `/var/lib/mysql/.': No such file or directory
df: no file systems processed
* /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Selecting previously deselected package mysql-client-5.0.
Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.51a-3ubuntu5_lpia.deb) ...
Selecting previously deselected package libterm-readkey-perl.
Unpacking libterm-readkey-perl (from .../libterm-readkey-perl_2.30-3ubuntu1_lpia.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.0.51a-3ubuntu5.1_all.deb) ...
/etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 1
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing /var/cache/apt/archives/mysql-server_5.0.51a-3ubuntu5.1_all.deb (--unpack):
subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.0_5.0.51a-3ubuntu5_lpia.deb
/var/cache/apt/archives/mysql-server_5.0.51a-3ubuntu5.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up libterm-readkey-perl (2.30-3ubuntu1) ...
Setting up libnet-daemon-perl (0.38-1.1) ...
dpkg: dependency problems prevent configuration of mysql-server-5.0:
mysql-server-5.0 depends on mysql-client-5.0 (>= 5.0.51a-3ubuntu5.1); however:
Version of mysql-client-5.0 on system is 5.0.51a-3ubuntu5.
dpkg: error processing mysql-server-5.0 (--configure):
dependency problems - leaving unconfigured
Setting up libplrpc-perl (0.2017-1.1) ...
Setting up libdbi-perl (1.601-1) ...
Setting up libdbd-mysql-perl (4.005-1) ...
Setting up mysql-client-5.0 (5.0.51a-3ubuntu5) ...
Errors were encountered while processing:
mysql-server-5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done
Please help!! I don't care about the data, I just need mysql back.
Thanks
Forgot to mention, I'm running Ubuntu 8.04 on a Dell Mini
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
try the following:
Code:
sudo chmod 775 /var/lib/mysql
It works for a lot of people
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
Sevenearths - I tried that and nothing still
I've searched for about a week online,trying any and every command and no success.
here are just a few of the commands I've run and all of them end in failure to complete their intention:
Code:
sudo apt-get --purge remove mysql-server
sudo apt-get --purge remove mysql-server
sudo apt-get install --reinstall mysql-server-5.0
sudo dpkg -P --force-all mysql-server-5.0
Here is what I get when I list all package with mysql
Code:
root@mike:/home/mike# dpkg -l | grep mysql
ii libapache2-mod-auth-mysql 4.3.9-4 Apache 2 module for MySQL authentication
ii libdbd-mysql-perl 4.005-1 A Perl5 database interface to the MySQL data
ii libmysqlclient15off 5.0.51a-3ubuntu5.1 MySQL database client library
ii mysql-admin 5.0~rc12-2ubuntu1 GUI tool for intuitive MySQL administration
ii mysql-client-5.0 5.0.51a-3ubuntu5.1 MySQL database client binaries
ii mysql-common 5.0.51a-3ubuntu5.1 MySQL database common files
ii mysql-gui-tools-common 5.0~rc12-2ubuntu1 Architecture independent files for MySQL GUI
pFR mysql-server-5.0 5.0.51a-3ubuntu5.1 MySQL database server binaries
ii php5-mysql 5.2.4-2ubuntu5.3 MySQL module for php5
What does pFR before mysql-server-5.0 mean? Can that be a clue??? I know i'm clueless :(
Any help is greatly appreciated!
Re: MySQL ERROR 2002 (HY000): Can't connect to local...
What happens when you type the following: