当前位置:网站首页>Linux deployment MySQL
Linux deployment MySQL
2022-07-27 01:48:00 【Little monkey_ xiao】
mysql install
Deployment environment :Linux centos 7.6
1. Online installation command
yum -y install mysql-server
2. Load Service Start the service
/etc/rc.d/init.d/mysqld start perhaps service mysqld restart
3. Set up mysql The service starts automatically
chkconfig mysqld on
4. see mysql Startup and self startup settings
chkconfig --list mysqld
(mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off) ← If 2--5 by on The state of OK
5. View the current mysql Version information
mysql --version
6. modify mysql Default encoding and sql Maximum length of statement execution
perform vi /etc/my.cnf command
stay [mysqld] Last addition :
default-character-set=utf8
character-set-server = utf8
init_connect='set names utf8'
max_allowed_packet = 50M
wait_timeout=27594000
restart mysql command : service mysqld restart
Enter into mysql Check the timeout :show global variables like 'wait_timeout';
7. Get into mysql View current code in
mysql>show variables like '%character%';
8. Set access rights and passwords
mysql> grant all privileges on *.* to 'root'@'%' identified by 'admin';
mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'admin';
mysql> flush privileges;
9. View the currently set access permission status
mysql> select user,host,password from mysql.user;
10. restart mysql service
service mysqld restart perhaps /etc/init.d/mysqld restart
11. Delete mysql( Execute again when there is an error in the installation )
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
12. See if it exists mysql( Execute again when there is an error in the installation )
rpm -qa|grep mysql // If there are any, please continue to delete
rpm -ql mysql // View file location
13. notes : Restart the server :reboot
边栏推荐
猜你喜欢
随机推荐
Network foundation of software test interview questions
33 three swordsman awk
小项目——开机自连校园网
Shell (8) cycle
FTP service
HarmonyOS图像处理应用开发实战直播笔记
Shell (7) case statement
Web server (01) -- Introduction to web server
Review of information acquisition technology
13、 Command gadget
Shell编程规范与变量
[SQL injection] error injection
Notes during in-depth learning (to be improved)
Domain name analysis and DNS configuration installation
shell循环语句
Shell (9) function
C language foundation Gobang, very easy to understand, detailed explanation, easy to use
RT-thread学习
31 regular expression
数字图像处理重点总结复习


![[ctf real question] 2018 WANGDING cup web unfinish](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)






