MySql basic operation this instance is a command line operation on the windows platform. First, create a new Super Administrator account in the mysql database. an error is returned when you log on to mysql. First, summarize the basic mysql operations (operations in the bin directory under the mysql root directory): (login to mysqlusername MySql basic operations)
This example is a command line operation on windows.
First, create a new Super Administrator account in the mysql database. an error is returned when you log on to mysql.
First, summarize the basic mysql operations (operations in the bin directory under the mysql root directory ):
(Login mysql username is the account name)
mysql -u username -p
(Display mysql databases)
show databases;
(Create a new database)
create database [databaseName];
(Determine which database to use, create tables, and view tables)
use databaseName;create table [tableName] (field1 type1,field2 type2...);show tables;
(Display the column of the table)
describe tableName;
(Delete table)
drop table [tableName];
(Delete database)
drop database [databaseName];
(Add user)
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘www’@'localhost’IDENTIFIED BY ’123456′ WITH GRANT OPTION;
(Add a super user account, username: www, password: 123456. you have full permissions to do anything. Account ('WWW '@ 'localhost') is only used for local connection)
E.g.
mysql> grant all privileges on *.* to 'tester' @'localhost' identified by 'tester' with grant option;Query OK, 0 rows affected (0.02 sec)mysql> flush privileges;Query OK, 0 rows affected (0.03 sec)mysql> GRANT ALL PRIVILEGES ON *.* TO ‘www’@'%’IDENTIFIED BY ’123456′ WITH GRANT OPTION;
(Add a super user account, username: www, password: 123456. you have full permissions to do anything. Account ('WWW '@' % ') can be used to connect from other hosts)
(Delete account)
drop user username...
E.g.
mysql> drop user tester @'localhost';Query OK, 0 rows affected (0.00 sec)
Reference link:
MySQL User account management (add, delete, restrict, set password, remote access)
Perform basic operations on the cmd command line to obtain administrator privileges.
1. in the directory C: \ Windows \ system32, right-click cmd.exe and run it as an administrator.
2. in win8, go to the metro page and click search in the upper-right corner. enter cmd and click "run as administrator"
3. open cmd and enter
D: \ mysql-5.6.19-winx64 \ bin> runas/user: adminitrator cmd enter adminitrator password: try to use cmd as user "LWQ \ adminitrator" start... RUNAS error: Failed-running 1326: incorrect user name or password.
Enter the adminitrator password as prompted. Unfortunately, I do not know the adminitrator password.