ubuntu 安装mysql
sudo apt-get install mysql-server sudo apt isntall mysql-client sudo apt install libmysqlclient-dev检测是否安装成功:
sudo netstat -tap | grep mysql
登录:
mysql -uroot -p你的密码
如果安装时没提示输入密码,则安装完成后
sudo vim /etc/mysql/debian.cnf
来查看账号和密码。
登录mysql,修改账号密码:
mysql> update mysql.user set authentication_string=password('new password') where user='root' and Host ='localhost'; mysql> update user set plugin="mysql_native_password"; mysql> flush privileges; mysql> quit;
退出mysql,重启mysql:
sudo service mysql restart