当前位置:网站首页>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 updatesudo apt install mysql-server-5.72. mysql edition
mysql -V3. see MySQL Default account and password
sudo cat /etc/mysql/debian.cnfTwo 、 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 mysqldFour 、 modify root Account secret authentication method
sudo cat /etc/mysql/debian.cnfpassword 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.cnf2. Save and exit , Get into mysql
mysql -uroot -pmysql> use mysql;
mysql> update user set host='%' where user = 'root';
mysql> flush privileges;restart
sudo service mysql restartCheck the status
systemctl status mysql.service6、 ... 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-commonClean up residual data
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
边栏推荐
猜你喜欢

The market is relatively weak recently

CSDN一站式云服务开放内测,诚邀新老用户来抢鲜
![delete和delete[]引发的问题](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
delete和delete[]引发的问题

吃一个女富豪的瓜。。。

How to launch circle of friends marketing and wechat group activities

Learning practice: comprehensive application of cycle and branch structure (II)

MapReduce编程基础

scratch大鱼吃小鱼 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月

7-Zip boycotted? The callers have committed "three crimes": pseudo open source, unsafe, and the author is from Russia!

电脑USB、HDMI、DP各种接口及速度
随机推荐
The market is relatively weak recently
Nacos service configuration and persistence configuration
嵌入式开发用到的一些工具
es6-顶层对象与window的脱钩
Clickhouse: Test on query speed of A-share minute data [Part 2]
ESP8266 FreeRTOS开发环境搭建
Mikrotik Routeros Internet access settings
CSDN's one-stop cloud service is open for internal testing, and new and old users are sincerely invited to grab the fresh
button按钮清除边框
Youqitong PE toolbox [vip] v3.7.2022.0106 official January 22 Edition
Introduction to expressions and operators in C language
SQL学习笔记(03)——数据约束关系
华为帐号多端协同,打造美好互联生活
js this丢失问题分析 及 解决方案
Meituan P4 carefully collated microservice system architecture design manual to see the world of microservice architecture
闭包实现迭代器效果
2022.02.15_ Daily question leetcode six hundred and ninety
主流实时流处理计算框架Flink初体验
IPv6 learning notes
睡了二哥。。。