当前位置:Gxlcms > 数据库问题 > mysql小知识

mysql小知识

时间:2021-07-01 10:21:17 帮助过:2人阅读

  1. windows_cmd 启动: net start mysql
  2. 停止 : net stop mysql
  3. linux 启动 : service mysql start或 /etc/inint.d/mysqld start
  4. 停止 : service mysql stop或 /etc/inint.d/mysqld stop

登陆客户端

  1. <span style="font-family: ‘comic sans ms‘, sans-serif; font-size: 14pt;"> mysql -uroot -proot -hlocalhost</span><br><span style="font-family: ‘comic sans ms‘, sans-serif; font-size: 16px; color: #888888;"> -u后面是用户名 -p后面是密码 -h后面是主机名,可以省略,默认是localhost</span>

允许远程访问mysql

  1. <span style="font-family: ‘comic sans ms‘, sans-serif; font-size: 16px;">GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘ WITH GRANT OPTION;
  2. FLUSH PRIVILEGES;</span>

导入和导出sql文件

  1. <span style="font-family: ‘comic sans ms‘, sans-serif; font-size: 18px;">导入:source D:/test.sql 或mysql -uroot -proot test < /data/<span style="color: #000000;">test.sql
  2. 导出:mysqldump </span>-uroot -proot test > /opt/test.sql</span>

 

 

 

 

 

 

 

 

 

                   

mysql小知识

标签:

人气教程排行