Create users and user groups first
Su-Root
Groupadd MySQL
Useradd-G MySQL decompress the binary file.
Tar zxvf mysql-5.0.51a-linux-i686.tar.gz
Copy the directory/home/MySQL to/usr/local. Create the MySQL license table:
[Root @ localhost root] # cd/usr/local/MySQL
[Root @ localhost MySQL] # scripts/mysql_install_db -- user = MySQL sets binary ownership to be owned by root and belongs to the MySQL Management Group:
[Root @ localhost MySQL] # chown-r root/usr/local/MySQL
[Root @ localhost MySQL] # chgrp-r MySQL/usr/local/MySQL:
[Root @ localhost MySQL] # chown-r MySQL/usr/local/MySQL/Data start server: different database servers use different commands to start the server, for example, if I install the MySQL-server-5.1.7-0.i386.rpm, so use it at startup
[Root @ localhost root] # service MySQL start instead of [root @ localhost root] # service mysqld start
Then it is shown as follows:
Starting MySQL success!
The errors may be as follows:
[Root @ localhost MySQL] # bin/MySQL-umysql
Error 2002 (hy000): Can't connect to local MySQL server through socket '/tmp/MYS
QL. Sock '(2)
Solution:
I went to the mysql. Sock file, under the/var/lib/MySQL. Sock directory, and then found the/tmp directory.
Then, log in as follows:
[Root @ localhost MySQL] # bin/MySQL-uroot-P
Enter password:
Welcome to the MySQL monitor. commands end with; or/g.
Your MySQL connection ID is 4
Server version: 5.1.7-beta
Type 'help; 'or'/H' for help. type'/C' to clear the buffer.
Here are some of my operations. You can also see some information:
Mysql> show databases;
+ --------------------- +
| Database |
+ --------------------- +
| Information_schema |
| Cluster_replication |
| MySQL |
| Test |
+ --------------------- +
4 rows in SET (0.13 Sec)
Mysql> show tables
->;
Error 1046 (3d000): No Database Selected
Mysql> use test
Database changed
Mysql> show tables
->;
Empty set (0.00 Sec)
Mysql>
The entry method is as follows:
[Root @ localhost MySQL] # bin/MySQL-uroot-P
Enter password:
Welcome to the MySQL monitor. commands end with; or/g.
Your MySQL connection ID is 5
Server version: 5.1.7-beta
Type 'help; 'or'/H' for help. type'/C' to clear the buffer.
Mysql>
My MySQL folder is in the directory/usr/local.