mysql数据库操作

连接mysql服务器:

mysql -u root -p

创建数据库:

create database agilefant default character set utf8mb4;

记住:永远不要在 MySQL 中使用 UTF-8 ->  https://www.jianshu.com/p/333175c97269

查看数据库:

show databases;

删除数据库:

drop database agilefant;

导出数据库:

mysqldump -u root -p agilefant >agilefant.sql

导入数据库:

use agilefant;

show tables;

source /root/agilefant/agilefant.sql;

show tables;

数据库访问用户名密码设置:

grant all on agilefant.* to agilefant@localhost identified by '[strong unique password]';


参考文档:

mysql 数据库导入导出方法总结  ->   https://www.cnblogs.com/tangou/p/7613896.html

你可能感兴趣的:(mysql数据库操作)