如何在一个空白的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
-- 清除残留数据工具