SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, whenever I first would try and start MySQL, it would quit because I didn't have a test database created. Check the man pages; I believe they give you the info you need.
The man pages may have the correct information. The file /etc/rc.d/rc.mysql is where most people get their information, I believe. To save you the trouble of looking, here's an excerpt that may help:
Quote:
# Before you can run MySQL, you must have a database. To install an initial
# database, do this as root:
#
# su - mysql
# mysql_install_db
#
# Note that step one is becoming the mysql user. It's important to do this
# before making any changes to the database, or mysqld won't be able to write
# to it later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
Okay, I tried "mysql_install_db" and it seemed to be successful (no errors) but I still can't start mysqld. I tried to set my password but it still said:
Code:
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
I really don't get this.
EDIT: I also tried "/usr/bin/mysqld_safe &" and that gave me this again:
Code:
root@darkstar:/var/lib/mysql# /usr/bin/mysqld_safe &
Starting mysqld daemon with databases from /var/lib/mysql
[1] 4164
root@darkstar:/var/lib/mysql# STOPPING server from pid file /var/lib/mysql/darkstar.pid
050105 16:09:57 mysqld ended
Last edited by darkarcon2015; 01-05-2005 at 03:11 PM.
Originally posted by Cedrik Could you post the output of :
ls -l /var/lib/mysql
Code:
root@darkstar:/var/lib/mysql# ls -l /var/lib/mysql
total 20568
-rw-rw---- 1 mysql root 9517 2005-01-05 16:09 darkstar.err
-rw-rw---- 1 mysql mysql 25088 2005-01-04 18:28 ib_arch_log_0000000000
-rw-rw---- 1 mysql mysql 5242880 2005-01-05 16:09 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2005-01-04 18:28 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 2005-01-05 16:09 ibdata1
drwx------ 2 root root 4096 2005-01-04 18:25 mysql
drwx------ 2 root root 4096 2005-01-04 18:25 test
[1]+ Done /usr/bin/mysqld_safe
It's not a bug, it's documented. The databases get bad ownership if you don't execute the commands as stated.
Probrably it would be better that mysql reports some kind of error when it can't read the databases, you could get a better start point than just "mysql ended".
You can always tell what errors MySQL encounters by going into the /var/lib/mysql directory, and viewing the ${hostname}.err file.
MySQL documents over and over and over... and over again, that all database files must be created ("mysql_install_db") and have "chown mysql:mysql /var/lib/mysql" done on the directory prior to even attempting to startup mysql. If one were to read the documentation at MySQL's website or check their mailing list archives, it is among the top issues people encounter. In the old days, it's oft referred to as "RTFM".
If you plan on using MySQL, I strongly encourage every person to read the online manual at http://dev.mysql.com/ to learn how to setup and secure their databases. By default, just about anyone can connect and alter any database by using a MySQL client application to connect to port 3306 of a new, unprotected server.
By the way, why are you using ""mysql-4.0.22-i486-1jim.tgz" from LinuxPackages.net"
Slackware comes with a perfectly good 4.0.24 and LinuxPackages has a 4.1.11 version.
Originally posted by kaon Is this a bug of MySQL itself?
Should we tell Pat about that?
A bug?
The first part of rc.mysqld file context is already posted to you.
Did you do
Code:
su - mysql
or
Code:
su mysql
as a root to become mysql user and then execute the mysql_install_db command the
mysql user and not as root?
Quote:
# Note that step one is becoming the mysql user. It's important to do this
# before making any changes to the database, or mysqld won't be able to write
# to it later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
I am kinda having the same problem. I have mysql running fine. I have also created databases using the mysql_install_db script. However, when i go to mysql and do SHOW DATABASES;, it just shows a test database when i have two databases "test" and "mysql" in /var/lib/mysql.
Can anyone give me any pointers...i'm stumped
Edit: i've chmoded /var/lib/mysql recursively to the user and group mysql.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.