|
Martin109
|
 |
« on: August 25, 2008, 07:56:06 am » |
|
I've installed mysql using Gslapt.
When I try to start it using 'mysql', I get the error message:
ERROR (2002) (HY000): Can't connect to local MySQL server through socket: '/tmp/mysql.sock' (2)
I searched around on the MySQL website and man pages, and tried:
mysql --host=127.0.0.1
as was suggested by one user, but this produced the error messge:
ERROR (2003) (HY000): Can't connect to local MySQL server through socket: '127.0.0.1' (111)
This problem seems to be known, but I'm struggling to understand how to work around it, being a newbie an' all...
|
|
|
|
« Last Edit: September 13, 2008, 03:04:32 am by Martin109 »
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
Martin109
|
 |
« Reply #1 on: August 25, 2008, 07:58:46 am » |
|
I tried running the command:
locate *.sock
and this came up with:
/var/run/cups/cups.sock /var/run/acpic.socket
so there's no mysql.sock anywhere.
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #2 on: August 25, 2008, 08:19:17 am » |
|
IIRC, 'mysql' log you into the mysql database (i.e. bring you to the mysql prompt). I believe you should be starting the server first with 'mysqld' or 'mysqld_safe', and then attempt logging into the server with 'mysql'.
I suspect you'll run into other problems when attempting to start the server, so if you do please post back and we'll help you get through those as well.
HTH! newt
|
|
|
|
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #3 on: August 25, 2008, 09:02:31 am » |
|
Typing 'mysqld' gives the result:
bash: mysqld: command not found
Typing 'mysqld_safe' gives the result:
nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var STOPPING server from pid file /var/vector.linux.net.pid 080825 16:32:13 mysqld ended
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #4 on: August 25, 2008, 10:32:14 am » |
|
I believe the issue you are running into is caused because you need to install the default mysql database with 'mysql_install_db' as mysql user (or root) - that way the mysql daemon has a base database to connect to and work with. If you do this as root then you will need to recursively change ownership of the database directory to the mysql user (i.e. chown -R mysql:mysql /var/lib/mysql/).
Next, try starting the server again as root: mysqld_safe.
If success, then set the mysql root password with: mysqladmin -u root password 'enter_your_new_password_here'
If no success, let us know
|
|
|
|
« Last Edit: August 25, 2008, 10:35:09 am by newtor »
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #5 on: August 25, 2008, 10:53:12 am » |
|
I believe the issue you are running into is caused because you need to install the default mysql database with 'mysql_install_db' as mysql user (or root) - that way the mysql daemon has a base database to connect to and work with. If you do this as root then you will need to recursively change ownership of the database directory to the mysql user (i.e. chown -R mysql:mysql /var/lib/mysql/).
Next, try starting the server again as root: mysqld_safe.
If success, then set the mysql root password with: mysqladmin -u root password 'enter_your_new_password_here'
If no success, let us know
Thank for this help! The first part went OK. The second stage did not. I issued the command: chown -R mysql:mysql /var/lib/mysql/ but got the message: chown: cannot access '/var/lib/mysql/': No such file or directory
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #6 on: August 25, 2008, 11:46:52 am » |
|
I expected the data directory to be there but since it's not you will need to determine where on your system the default database was installed (some possibilities are listed below): /var/lib/mysql/ (you said not here) /var/mysql/ /usr/lib/mysql/ The directory should be identifiable by containing files with the extension: .frm, .myd, .myi. Once you find that directory, perform the previous task using that directory path. i.e. chown -R mysql:mysql /path/to/mysql/data/files/ and then finish up with: Next, try starting the server again as root: mysqld_safe. If success, then set the mysql root password with: mysqladmin -u root password 'enter_your_new_password_here' I wish I knew off the top of my head where that mysql data directory was located :shrug:
|
|
|
|
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #7 on: August 25, 2008, 12:22:26 pm » |
|
I've tried the command: locate mysql
and the output is: /usr/doc/perl-5.8.8/DBD-mysql-4.001 /usr/doc/perl-5.8.8/DBD-mysql-4.001/TODO /usr/doc/perl-5.8.8/DBD-mysql-4.001/README /usr/doc/perl-5.8.8/DBD-mysql-4.001/INSTALL.html /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/DBD/mysql /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/DBD/mysql/GetInfo.pm /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/DBD/mysql/INSTALL.pod /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/DBD/mysql.pm /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBD/mysql /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBD/mysql/.packlist /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBD/mysql/mysql.bs /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBD/mysql/mysql.so /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/Bundle/DBD/mysql.pm /usr/lib/gambas/lib.gb.db.mysql.la /usr/lib/gambas/lib.gb.db.mysql.so /usr/lib/gambas/lib.gb.db.mysql.so.0.0.0 /usr/lib/gambas/lib.gb.db.mysql.so.0 /usr/lib/qt-3.3.8/plugins/sqldrivers/libqsqlmysql.so /usr/man/man3/DBD::mysql.3.gz /usr/man/man3/DBD::mysql::INSTALL.3.gz /usr/man/man3/Bundle::DBD::mysql.3.gz /usr/share/vim/vim71/syntax/mysql.vim /usr/share/apps/katepart/syntax/sql-mysql.xml
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
Martin109
|
 |
« Reply #8 on: August 25, 2008, 12:29:43 pm » |
|
/var/lib/mysql/ (you said not here) /var/mysql/ /usr/lib/mysql/
I've looked around with File manager and found: /var/mysql which does not let me enter it. And /usr/lib/mysql which contains 11 items, most of them with siffix .a
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #9 on: August 25, 2008, 12:36:33 pm » |
|
As root, in a terminal, list the contents of /var/mysql. I'm hoping that you see the data table files with the extensions indicated above
example) su enter your root password when prompted ls /var/mysql
/usr/lib/mysql does not seem to be the correct location based on your description of the contents.
|
|
|
|
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #10 on: August 25, 2008, 12:43:00 pm » |
|
Great! ls /var/mysql produced: columns_priv.MYD columns_priv.MYI columns_priv.frm db.MYD db.MYI db.frm func.MYD func.MYI func.frm help_category.MYD help_category.MYI help_category.frm help_keyword.MYD help_keyword.MYI help_keyword.frm help_relation.MYD help_relation.MYI help_relation.frm help_topic.MYD help_topic.MYI help_topic.frm host.MYD host.MYI host.frm proc.MYD proc.MYI proc.frm procs_priv.MYD procs_priv.MYI procs_priv.frm tables_priv.MYD tables_priv.MYI tables_priv.frm time_zone.MYD time_zone.MYI time_zone.frm time_zone_leap_second.MYD time_zone_leap_second.MYI time_zone_leap_second.frm time_zone_name.MYD time_zone_name.MYI time_zone_name.frm time_zone_transition.MYD time_zone_transition.MYI time_zone_transition.frm time_zone_transition_type.MYD time_zone_transition_type.MYI time_zone_transition_type.frm user.MYD user.MYI user.frm
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #11 on: August 25, 2008, 12:50:45 pm » |
|
Great, you found it!! The next steps would be to change ownership of the directory to the 'mysql' user, start the mysql daemon/server, and change the root password. The next possible point of trouble is starting the server (mysqld_safe). Hopefully you do not see this line again: STOPPING server from pid file /var/vector.linux.net.pid as root: chown -R mysql:mysql /var/mysql/ mysqld_safe If success, then set the mysql root password with: mysqladmin -u root password 'enter_your_new_password_here'
|
|
|
|
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #12 on: August 25, 2008, 01:13:46 pm » |
|
Partial success again?! Issued command chown -R mysql:mysql /var/mysql/
as root, and was returned to prompt without any output or messages (success?) But, command: mysqld_safe
produced same error message (viz.): nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var STOPPING server from pid file /var/vector.linux.net.pid 080825 20:40:13 mysqld ended
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|
newt
|
 |
« Reply #13 on: August 25, 2008, 01:54:30 pm » |
|
Looks like the ownership change was successful.
Getting the server started-- It seems to be looking in the wrong place for the data directory /var rather than /var/mysql. I wonder if the mysql.server script will work any better to get the daemon/server started. The command should be: ./etc/init.d/mysql.server start & (this is, of course, assuming the script is set to executable).
As an alternative: At this point you may also find that the service 'mysql' shows up in VASMs startup services section, and it may be as simple as checking the box and rebooting to get the mysql daemon started.
Just so you know, you are very close to getting the server started, and once you have it working you won't need to monkey with any of this again.
Cheers!
|
|
|
|
|
Logged
|
|
|
|
|
Martin109
|
 |
« Reply #14 on: August 25, 2008, 11:44:06 pm » |
|
Many thanks for this. Unfortunately, work will take me away from this machine for a couple of days, but I should be able to check out your further suggestions from Thursday onwards. If there are any further problems, I'll let you know. Thanks again! 
|
|
|
|
|
Logged
|
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard
Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard
|
|
|
|