Creation and operation of MySQL database and data table
1. Log in to MySQL
cd /usr/local/mysql/bin
mysql -u root -p
At this time, it will pop up to enter the password, and then you can log in.
2. View the current database
show databases;
3. Create a database
create database budaye_test01 default character set utf8;
4. Use the newly created database
use budaye_test01
5. Query the created table
show tables;
6. Create database tables
create table now_list(
id int primary key auto_increment,
name varchar(50),
age int
);
7. Query table content
select *from name_table;
8. Delete database tables
DROP TABLE now_tasks;
9. MySQL exit
There are three ways to exit mysql:
- mysql > exit;
- mysql > quit;
- mysql > \q;
PS: For more more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"