Installation Environment:
operating system: SuSE Linux 10
Database: MySQL 5.0.22
Hope to know more experts, learn from each other to discuss technology!
First vent then this, the Internet to see more than the installation of MySQL articles, most of the same, are not very good to install MySQL; more or less have problems; most of the personal view of the original text, copy to their own blog or some online, pure theft Ah! At the end of last week began to plan to install SuSE and MySQL, until this afternoon finally came to show databases; too dizzy! Now I put every step of my MySQL installation here, as a total of the need to view, but also to prevent the future of their own observation;
Note: When installing SUSE Linux, it is important to choose the one that has been developed by C/D + +; Listen to the company predecessors.
Specific installation steps:
1. Download package mysql-5.0.22.tar.gz, address http://www.mysql.com, generally do not recommend the installation of the RPM form;
2. Put the downloaded mysql-5.0.22.tar.gz in the USR directory and unzip:
Copy Code code as follows:
# tar zvxf mysql-5.0.22.tar.gz
3.# CD mysql-5.0.22//into the uncompressed file directory;
4./configure--prefix=/usr/local/mysql--with-charset=gbk//set up the installation directory, note that the front is./configure Dot bar;
5. Compile: # make//Only one make is enough
6. Installation: # make install//These two steps take some time.
7. Add a MySQL user group and set permissions after installation:
Copy Code code as follows:
# useradd MySQL
# Cd/usr/local/mysql
# bin/mysql_install_db--USER=MSYQL
# Chown-r Root:mysql.
# chown-r MySQL var
# chgrp-r MySQL.
# CP SHARE/MYSQL/MY-LARGE.CNF/ETC/MY.CNF
See that there is a small point behind some;
8. Set the boot from the MySQL service:
Copy Code code as follows:
# CP//usr/local/mysql/share/mysql/mysql.server/etc/init.d/mysql
#chmod 755/etc/init.d/mysql
#chkconfig--add MySQL
#/etc/init.d/mysql Start
My linux is SuSE, so here init.d is under the etc. Other possible positions are not the same;
Then reboot the system: Reboot Oh, wait.
9. Running MySQL
Boot at the end of the directory into MySQL:
Start Services: Service MySQL Start
Copy Code code as follows:
#cd/usr/local/mysql/bin
#./mysql-u root-p
Then you'll be prompted to enter password:
Enter your password to enter MySQL;
10. Can also manually start the MySQL service:
Copy Code code as follows:
#/usr/local/mysql/bin/mysqld_safe--user=root &/Start MySQL
11. Modify the Password: You can also set this
#/usr/local/mysql/bin/mysqladmin-u root password ' your password '//modify password
12. Close MySQL Service:
Copy Code code as follows:
#/usr/local/mysql/bin/mysqladmin-u Root-pmysqlsecret shutdown//close MySQL
So the rest of the database is only the operation of the, hey sigh of relief, fast dizzy dead!!
13. Forgot to uninstall the MySQL method to fill up:
Into the file that was extracted from MySQL.
Copy Code code as follows:
#cd/usr/mysql-5.0.22
#make Uninstall
Finish, and finally to put those who do not want to delete the MySQL folder can also be more thorough!
Copy Code code as follows:
Mysql> grant all privileges in *.* to ' root ' @ '% '
-> identified by ' Root ' with GRANT option;
Query OK, 0 rows affected (0.05 sec)
Mysql> select Host,user from Mysql.user;
+----------------+--------+
| Host | user |
+----------------+--------+
| 192.168.61.113 | Root |
| localhost | Jason |
| localhost | Prod |
| localhost | Qsrock |
| localhost | Radius |
| localhost | Root |
+----------------+--------+
Use the method described on the web to modify the password of the root user:
Copy Code code as follows:
# mysqladmin-uroot-p password ' newpassword '
Enter Password:
Mysqladmin:connect to server at ' localhost ' failed
Error: ' Access denied for user ' root ' localhost ' (using Password:yes) '
Now finally I found the solution, as follows (please test method three, thank you!) ):
Method One:
Copy Code code as follows:
#/etc/init.d/mysql Stop
# Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
# mysql-u Root MySQL
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
mysql> FLUSH privileges;
Mysql> quit
#/etc/init.d/mysql Restart
# mysql-uroot-p
Enter Password: < Enter the new password newpassword>
Mysql>