LNMP中安装mysql5的一些问题及解决

【LNMP中安装mysql5的一些问题及解决】[root@localhost mysql-5.0.40]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[root@localhost mysql-5.0.40]# cd /usr/local/mysql/bin
[root@localhost bin]# ./mysql_install_db
[root@localhost bin]# cd ..
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# cd var
[root@localhost var]# ls
mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.index test
[root@localhost var]# cd ..
[root@localhost mysql]# /usr/local/mysql/bin/mysqld
mysqld_multi mysqld_safe mysqldump mysqldumpslow
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[2] 23080
[root@localhost mysql]# chown: ‘mysql’: 无效的用户
Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/localhost.localdomain.pid
080707 05:37:38 mysqld ended
[2]- Done /usr/local/mysql/bin/mysqld_safe
[root@localhost mysql]#
[root@localhost mysql]# chmod -R 777 var/
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[2] 23111
[root@localhost mysql]# chown: ‘mysql’: 无效的用户
Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/localhost.localdomain.pid
080707 05:39:17 mysqld ended
[2]- Done /usr/local/mysql/bin/mysqld_safe
[root@localhost mysql]# groupadd mysql
[root@localhost mysql]# useradd mysql
useradd: group mysql exists - if you want to add this user to that group, use -g.
[root@localhost mysql]# useradd mysql -g mysql
[root@localhost mysql]# bin/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password "new-password"
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password "new-password"
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# chown -R root
chown: 参数太少
请尝试执行‘chown --help’来获取更多信息 。
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql var
[root@localhost mysql]# chown -R mysql var/.
[root@localhost mysql]# chown -R mysql var/mysql/.
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# bin/mysqld_safe --user=mysql &
[2] 30060
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# cp share/mysql/mysql
mysql_fix_privilege_tables.sql mysql_system_tables_data.sql
mysql-log-rotate mysql_system_tables.sql
mysql.server mysql_test_data_timezone.sql
[root@localhost mysql]# cp share/mysql/mysql
mysql_fix_privilege_tables.sql mysql_system_tables_data.sql
mysql-log-rotate mysql_system_tables.sql

推荐阅读