Mysql learning, mysql
1. log on to mysql and enter the mysql bin directory:
mysql -u root -p
Enter the password after you press Enter. After the database is created, the root password is blank and you can directly press enter to log on. You can also specify the data when logging on again:
mysql -u root dbname -p
2. Modify the root user password:
Method 1:
mysql> set password for 'root'@'localhost'=password('sywu');
Method 2: directly update the user table:
mysql> use mysql
Database changed
mysql> update user set password=password('sywu') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 3 Changed: 2 Warnings: 0
3. view the database:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cdcol |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
| webauth |
| wordpress |
+--------------------+
8 rows in set (0.00 sec)
4. connect to a database:
mysql> use mysql;
Database changed
How to Learn MYSQL
Install Mysql first, and then read the book. For more information, see what Mysql knows first.
Other good books include:
High-performance MySQL
MySQL core technical manual
MySQL performance tuning and Architecture Design
Deep understanding of MySQL core technologies
MySQL core information
MySQL developer SQL authoritative guide
MySQL technology insider InnoDB Storage Engine
In-depth understanding of MySQL
MySQL authoritative guide
Is there any good tutorial for learning MySQL?
Dev.mysql.com/doc/refman/5.1/zh/index.html
MYSQL official documentation.
In addition, mysql is recommended, which is about 30 yuan.