Home  >  Article  >  Database  >  mysql 授权root帐号可以远程访问,导入sql文件,登录mysql用root帐

mysql 授权root帐号可以远程访问,导入sql文件,登录mysql用root帐

WBOY
WBOYOriginal
2016-06-07 15:25:061197browse

安装好了之后,MySQL默认是空密码,可以为root用户设置密码 ,注意大小写 mysql SET PASSWORD FOR root@'localhost' = PASSWORD('admin'); //登录mysql用root帐号 $mysql --user=root --password=root mysql //授权root帐号可以远程访问 mysqlgrant all priv

安装好了之后,MySQL默认是空密码,可以为root用户设置密码 ,注意大小写
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('admin');

//登录mysql用root帐号
$>mysql --user=root --password=root mysql

//授权root帐号可以远程访问
mysql>grant all privileges on *.* to 'root'@'%' identified by 'root';

 

//删除数据库
drop database test;
创建数据库
create dababase test;


//导入sql文件
#创建数据库
create database jeecms_2012;
source /home/zhangshibo/jeecms.sql;

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn