ubuntu16.04安装mysql数据库

第一步:安装MySQL

sudo apt-get update
sudo apt-get install mysql-server

第二步:配置MySQL

sudo mysql_secure_installation

系统会提示用户输入root密码,输入之后一路确定就可以。

第三步:测试MySQL

systemctl status mysql.service

将会看到以下的内容:

mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en Active: active (ru

最后,如果mysql没有运行,可以通过以下方法启动它

sudo systemctl mysql start

猜你喜欢

转载自blog.csdn.net/weixin_42634193/article/details/84195836
今日推荐