当前位置:网站首页>Ubuntu system installation and MySQL configuration
Ubuntu system installation and MySQL configuration
2022-07-01 09:42:00 【Yimuzixi】
One 、 install MySQL
1. install mysql service
sudo apt-get update
sudo apt install mysql-server-5.7
2. mysql edition
mysql -V
3. see MySQL Default account and password
sudo cat /etc/mysql/debian.cnf
Two 、 To configure MySQL
sudo mysql_secure_installation
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N
#2
Please set the password for root here...
New password: ( Input password )
Re-enter new password: ( Repeat input )
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N
#4
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N
#5
By default, MySQL comes with a database named 'test' that
anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
3、 ... and 、 see mysql Service status
systemctl status mysql.service
ps -ef|grep mysqld
Four 、 modify root Account secret authentication method
sudo cat /etc/mysql/debian.cnf
password The next is the password
Then type on the command line :
mysql -u debian-sys-maint -p
- In the presence of Enter password Enter the password above , Get into mysql Command mode
- Create database , Change Password
use mysql;
update mysql.user set authentication_string=('password') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password";
flush privileges;
quit;
5、 ... and 、 Configure remote access mysql
1. Modify the configuration file , Comment out bind-address = 127.0.0.1
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
2. Save and exit , Get into mysql
mysql -uroot -p
mysql> use mysql;
mysql> update user set host='%' where user = 'root';
mysql> flush privileges;
restart
sudo service mysql restart
Check the status
systemctl status mysql.service
6、 ... and 、 Delete MySQL
Delete mysql:
sudo apt autoremove --purge mysql-server-*
sudo apt remove mysql-server
sudo apt autoremove mysql-server
sudo apt remove mysql-common
Clean up residual data
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
边栏推荐
- js重写自己的函数
- MapReduce programming basics
- ES6 const essence and completely immutable implementation (object.free)
- Niuke monthly race 22- collect pieces of paper
- PHP array functions (merge, split, append, find, delete, etc.)
- JS scope chain and closure
- uniapp微信小程序组件按需引入
- SQL学习笔记(04)——数据更新、查询操作
- 全球基金和资管的股票建仓率达到15年内新低
- JS原型链
猜你喜欢
Concept of digital currency
Huawei accounts work together at multiple ends to create a better internet life
7-Zip boycotted? The callers have committed "three crimes": pseudo open source, unsafe, and the author is from Russia!
Problems caused by delete and delete[]
Dspic30f6014a LCD block display
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
硬件中台项目
电脑USB、HDMI、DP各种接口及速度
集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
PHP code audit and File Inclusion Vulnerability
随机推荐
Analysis and solution of JS this loss
主流实时流处理计算框架Flink初体验
Swag init error: cannot find type definition: response Response
SQL学习笔记(04)——数据更新、查询操作
全球基金和资管的股票建仓率达到15年内新低
Weidongshan board compilation kernel problem solving
闭包实现迭代器效果
PHP 字符串与二进制相互转换
Installation and use of NoSQL database
Tree structure --- binary tree 1
SQL learning notes (01) - basic knowledge of database
123. how to stop a thread?
Project procurement management
Exception handling of classes in C #
SQL learning notes (02) - database table operation
Error org apache. catalina. core. StandardContext. FilterStart start filter exception
CSDN一站式云服务开放内测,诚邀新老用户来抢鲜
ES6-const本质与完全不可改实现(Object.freeze)
node. How to implement the SQL statement after JS connects to the database?
PHP code audit and File Inclusion Vulnerability