linux下mysql的一些基本操作

来源:互联网 发布:食品包装设计软件 编辑:程序博客网 时间:2024/04/29 18:30

进入mysql路径

cd /usr/local/mysql

开启/关闭mysql服务

sudo ./support-files/mysql.server start/stop

允许root远程登陆:

    1)本机登陆mysql:mysql -u root -p (-p一定要有);改变数据库:use mysql;

    2)从所有主机:grant all privileges on *.* to root@"%" identified by "passw0rd" with grant option;

    3)从指定主机:grant all privileges on *.* to root@"192.168.1.101" identified by "passw0rd" with grant option; flush privileges;

    4)  进mysql库查看host为%的数据是否添加:use mysql; select * from user;



0 0