如何在一個空白的ecs上新建一個mysql服務mysql
買了一個這種配置的,入門級學習用的,400大洋sql
購買以後會配置實例,到時選擇ubuntu就能夠,而後設置密碼;ubuntu
wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
30M左右sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
systemctl status mysql.service
sudo mysqladmin -p -u root version
sudo myql
便可,alter user 'root'@'localhost' identified with mysql_native_password by 'Qqww@123'
正常不用加'with mysql_native_password',之因此加,是由於一些第三方密碼工具不及時;create user 'yang'@'%' identified by 'Qqww@123';
grant all privileges on *.* to 'yang'@'%' with grant option;
flush privileges
show global variables like 'port'
在外部這樣 netstat -an|grep 3306
create schema mall default character set utf8 collate utf8_unicode_ci;
複製一個規則,把它設爲mysql的規則, 安全
把mysql Workbence更新成8的就能夠設置訪問了.ide
一、 sudo apt-get remove mysql-server
二、sudo apt-get autoclean
清除已卸載軟件包 三、sudo apt-get remove mysql-common
--這個很重要 四、dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
-- 清除殘留數據工具