linux-mysql command

1. View the mysql process 

ps -ef |grep mysql

2. View the running status of mysql

service mysqld status

3. View the port mysql listens on

netstat -tlnp | grep mysql

4. Start the MySQL service

net start mysql 或 service mysql start

5. Stop Mysql service

systemctl stop mysqld

6. Connect to mysql

mysql -u root -p 

7. Display database

show databases;

8. Create a new database

create database xxx;

9. View mysql version

mysqld --version

10. View the character set of the table

 SHOW CREATE TABLE decoration.SYS_USER;

11. Modify the character set of the table

ALTER TABLE decoration.SYS_USER CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

12. Modification of database + table character set

Database: How to modify the mysql character set under linux_Internet Cloud

Database table: database encoding problem, which makes it impossible to insert data into the table; Incorrect string value_Why the database table does not allow data to be inserted_bobojie toilet Ling blog-CSDN blog

Guess you like

Origin blog.csdn.net/xujinwei_gingko/article/details/130986510