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.
to login to mysql as root if root password is not enabled:
Code:
mysql -u root
or
Code:
mysql -u root -p
if password is enabled.
*EDIT*
after -p press enter and you'll get a prompt to type the password.
Code:
mysql -u root -p <something>
DOES NOT MEAN login as user "root" and with password "<something>". It means login as user "root" into database "something" and you'll still get a prompt to type a password. I mention this because it's a really common mistake people do.
Last edited by perfect_circle; 06-26-2005 at 01:17 PM.
When someone tells you login as root in mysql, it means login as the mysql root user. Not as the root system user.
If you don't specify a user with -u in the mysql command mysql will use your system username as a mysql username but you don't need to become root, in order to login to mysql as mysql root user.
Originally posted by shilo 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: [snip]
Why not put something like this at the start of the data base install script:
Code:
## Verify that we aare running as "mysql" in the "mysql" group
myname="$(id -un)"
mygroup="$(id -gn)"
if [ "${myname}" != "mysql" -o "${mygroup}" != "mysql" ]
then
echo This script \($0\) can only be run by
echo user \\'mysql\\' in group \\'mysql\\'.
echo
echo You are user \\'${myname}\\' in group \\'${mygroup}\\'.
echo
echo To run this script do this, as root:
echo
echo \# su - mysql
echo \# $0
echo
echo Note that step one is becoming the mysql user. It\\'s important to do this
echo before making any changes to the database, or mysqld won\\'t be able to write
echo to it later \(this can be fixed with \\'chown -R mysql.mysql /var/lib/mysql\\'\).
echo
echo Aborting.
exit 1
fi
This seems like a rather simple thing to do, and would save a lot of questions.
mysql@turd:/usr$ ls -l /var/lib/mysql
total 20576
-rw-rw---- 1 mysql mysql 25088 2005-02-24 11:15 ib_arch_log_0000000000
-rw-rw---- 1 mysql mysql 5242880 1999-04-06 18:37 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2005-02-24 11:15 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 1999-04-04 20:04 ibdata1
-rw-rw---- 1 mysql mysql 2363 1999-04-06 19:01 innodb.status.2562
drwx------ 2 mysql mysql 4096 1999-04-06 18:30 mysql
drwx------ 2 mysql mysql 4096 1999-04-06 18:30 test
-rw-rw---- 1 mysql mysql 15065 1999-04-06 18:59 turd.err
It seems like its not installed correctly (even though it installed with slackware). Do I need to create that file?
Very weird, the host (it consists of three files, host.MYD, host.MYI and host.frm) table should be inside that mysql directory that's listed there. Check if it exists, if it doesn't run mysql_install_db again with the mysql user. To do that run as root:
su - mysql
mysql_install_db
exit
If the table exists, check it's permissions, it should be owned by mysql user and mysql group and have read-write permission for user and group too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.