Mysql.linux登录数据库

//mysql -hlocalhost -uroot -p
//-h数据库地址 -u用户名 -p密码 -P端口号(P大写)//-p可省略,会提示输入密码。

mysql -h127.0.0.1 -uroot -p123456 -P3306 

//建立数据库
drop database if exists 数据库名;
create database 数据库名 CHARACTER SET utf8 COLLATE utf8_general_ci;
 
//授限给新用户
grant all privileges on leather.* to '用户名'@'%' identified by '密码';
FLUSH PRIVILEGES;
 
原文地址:https://www.cnblogs.com/initx/p/11718427.html