当前位置:网站首页>MySQL installation, uninstallation, initial password setting and general commands of Linux
MySQL installation, uninstallation, initial password setting and general commands of Linux
2022-07-03 13:19:00 【Levi Bebe】
1. install MySQL
Update source and install MySQL:
sudo apt-get update # Update source
sudo apt-get install mysql-server # install mysql
Check MySQL Is the installation successful :
because mysql After installation , It will start automatically, so you can check the running status , Verify that the installation was successful .
systemctl status mysql ## see mysql state
systemctl Use of commands and view of service status 
mysql --version ## see mysql edition

It can be verified by the above two methods mysql Is the installation successful .
2. uninstall MySQL
sudo rm /var/lib/mysql/ -R # Delete database directory
sudo rm /etc/mysql/ -R # Delete startup script 、 Configuration files, etc
sudo apt-get autoremove mysql* --purge # uninstall mysql All the files
sudo apt-get remove apparmor # This apparmor It's pretending mysql-server In fashion , Safety related
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P # Clean up the residue mysql file
3. Check the initial account and password
3.1 Check the initial account and password
Because when installing , No password set ,mysql The account and password will be automatically generated , Use the following command to view :
sudo cat /etc/mysql/debian.cnf
result :
3.2 Change account and password
1. Use the initialization account password to enter mysql, Everyone's initialization password is different :
mysql -u debian-sys-maint -p
Successfully logged in , Here's the picture :
2. Set up root Password :
user Medium root It's an account ,password It's a password :bianbian123
update mysql.user set authentication_string=password("88888888"),plugin='mysql_native_password' where user='root';
The results are shown in the following figure :
3. sign out mysql
flush privileges; # Hit enter , Update and modify
quit; # Hit enter , sign out

4. restart mysql, And login
restart :
systemctl restart mysql
Sign in :
mysql -u root -p88888888

4. Normal operation
systemctl start mysql # Turn on mysql
systemctl stop mysql # stop it mysql
systemctl restart mysql # restart mysql
systemctl status mysql # mysql Running state
Reference resources :
https://blog.csdn.net/cruiserblog/article/details/106934570
https://www.it610.com/article/1304140137831108608.htm
http://www.manongjc.com/detail/11-tzeibqtfcoijnye.html
https://www.cnblogs.com/benjamin77/p/8681763.html
https://www.cnblogs.com/cpl9412290130/p/9583868.html
边栏推荐
- Mysqlbetween implementation selects the data range between two values
- Understanding of CPU buffer line
- The difference between session and cookie
- Logseq evaluation: advantages, disadvantages, evaluation, learning tutorial
- Sitescms v3.1.0 release, launch wechat applet
- R语言使用data函数获取当前R环境可用的示例数据集:获取datasets包中的所有示例数据集、获取所有包的数据集、获取特定包的数据集
- Ubuntu 14.04 下开启PHP错误提示
- Slf4j log facade
- 2022-02-09 survey of incluxdb cluster
- Flink SQL knows why (13): is it difficult to join streams? (next)
猜你喜欢

Sword finger offer 14- ii Cut rope II

MySQL constraints

35道MySQL面试必问题图解,这样也太好理解了吧

18W word Flink SQL God Road manual, born in the sky

Flink SQL knows why (XI): weight removal is not only count distinct, but also powerful duplication

Sword finger offer 12 Path in matrix
![[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]](/img/47/78d9dd098dcb894ba1f459873d5f52.png)
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]

今日睡眠质量记录77分

Typeerror resolved: argument 'parser' has incorrect type (expected lxml.etree.\u baseparser, got type)

Tutoriel PowerPoint, comment enregistrer une présentation sous forme de vidéo dans Powerpoint?
随机推荐
高效能人士的七个习惯
父亲和篮球
The difference between session and cookie
Sitescms v3.0.2 release, upgrade jfinal and other dependencies
Today's sleep quality record 77 points
Ubuntu 14.04 下开启PHP错误提示
2022-01-27 redis cluster technology research
Reptile
stm32和电机开发(从mcu到架构设计)
[colab] [7 methods of using external data]
Flink SQL knows why (XIV): the way to optimize the performance of dimension table join (Part 1) with source code
2022-02-09 survey of incluxdb cluster
SLF4J 日志门面
已解决(机器学习中查看数据信息报错)AttributeError: target_names
Will Huawei be the next one to fall
8皇后问题
Tencent cloud tdsql database delivery and operation and maintenance Junior Engineer - some questions of Tencent cloud cloudlite certification (TCA) examination
2022-02-11 heap sorting and recursion
PostgreSQL installation
When the R language output rmarkdown is in other formats (such as PDF), an error is reported, latex failed to compile stocks Tex. solution