首页 > 代码库 > 树莓派安装Mysql

树莓派安装Mysql

安装mysql,安装过程中会要求输入2次密码

sudo apt-get install mysql-server

启动mysql,默认是自动启动

sudo service mysql start

关闭mysql

sudo service mysql stop

重启mysql

sudo service mysql restart

mysql无法远程访问,执行以下代码

mysql -uroot -p 先登录mysql
GRANT ALL PRIVILEGES ON *.* TO root@% IDENTIFIED BY 123456 WITH GRANT OPTION;
flush privileges;

 

树莓派安装Mysql