Suse Linux 10 MySql installation and configuration steps
- 2020-09-28 09:11:40
- OfStack
Installation environment:
Operating system: suse Linux 10
Database: MySQL 5.0.22
Hope to know more masters, learn from each other to discuss technology!
First vent 1 again this, read N more installation mysql articles, most of the same little difference, can not be very good installation of mysql; It's more or less a problem; With the personal view is mostly 1 original, copy to respective blog or 1 some net, pure theft! Plans for the installation of suse and mysql began last weekend. 1 It was not until this afternoon that show databases finally arrived. Too dizzy! I've now put each step of my mysql installation here for the co-user, in case you ever see it again.
Note: When installing suse linux, select C/C++ to develop the 1 item. Listen to the company seniors.
Specific installation steps:
1. Download package mysql - 5.0.22. tar. gz, address http: / / www mysql. com, 1 kind is not recommended to install rpm form;
2. Put the downloaded ES38en-5.0.22. tar. gz in usr directory and unzip:
# tar zvxf mysql-5.0.22.tar.gz
3.# cd mysql-5.0.22 // Enter the uncompressed file directory;
4../configure --prefix=/usr/local/mysql -- ES54en-ES55en =gbk// Set the installation directory./configure dot bar;
5. Compile: # make // Just 1 make is enough
6. Installation: # make install // Both steps take a while
7. Add 1 mysql user group after installation and set permissions:
# 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's a little dot behind some of them;
8. Set up mysql service from startup:
# 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 etc. Other possible positions are not one;
Then reboot the system: reboot wait
9. mysql operation
Boot into the mysql directory at the terminal:
Start service: service mysql start
#cd /usr/local/mysql/bin
# ./mysql -u root -p
Enter password is then prompted:
Enter your password to enter mysql;
10. mysql service can also be started manually:
# /usr/local/mysql/bin/mysqld_safe --user=root & // Start the MySQL
11. Change password: This can also be set
# / usr local/mysql/bin/mysqladmin - u root password "your password" / / change the password
12. Turn off mysql:
# /usr/local/mysql/bin/mysqladmin -u root -pmysqlsecret shutdown // Shut down MySQL
So the rest of the database is only the operation, ah breathe a sigh of relief, quickly dizzy dead!!
13. Forgot to uninstall mysql.
Go to the file under mysql unzip
#cd /usr/mysql-5.0.22
#make uninstall
Finished, finally to those do not want about mysql folder deleted also can, that is more thorough!
mysql> grant all privileges on *.* 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 online method to change the password of root users:
# 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 I finally found the solution, as follows (please test method 3 first, thank you!) :
Method 1:
# /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>