标签:
1、修改root用户登录密码:
[root@17track bin]# /usr/local/mysql/bin/mysqladmin -u root password ‘MyPassword‘
2、登录数据库:
[root@17track bin]# /usr/local/mysql/bin/mysql -uroot -pMyPassword
3、创建数据库:
mysql> create database MyDatabase default character set utf8 collate utf8_general_ci;
4、添加用户:
mysql> grant all on MyDatabase.* to ‘MyUser‘@‘localhost‘ identified by ‘MyPassword‘;
5、删除用户:
mysql> drop user ‘‘@localhost;
6、删除数据库:
mysql> drop database MyDatabase;
7、导出数据库:
[root@17track bin]# /usr/local/mysql/bin/mysqldump -uMyUser -p MyDatabase --default-character-set=utf8 > MyDatabase.sql
8、导入数据库:
[root@17track bin]# /usr/local/mysql/bin/mysql -uMyUser -p MyDatabase < MyDatabase.sql
9、确认提交信息:
mysql> flush privileges;
10、选定数据库:
mysql> use mysql;
11、查看当前数据中的表:
mysql> show tables;
12、查看数据库中表的结构:
mysql> desc users;
13、按条件查询:
mysql> select user,host,password from user;
14、查看数据库系统信息:
mysql> status;
15、查看数据库支持的引擎信息:
mysql> show engines;
16、查看数据库加载的插件信息:
mysql> show plugins;
标签:
原文地址:http://www.cnblogs.com/configure/p/5477300.html