Start/Stop database Sudo /applications/xampp/xamppfiles/bin/mysql.server start (stop) connection database bash-3.2# / applications/xampp/xamppfiles/bin/mysql -u root -penter password: Show All Databases mysql> show databases;+--------------------+| database |+--------------------+| information_schema | | blog | | cdcol | | mysql | | performance_schema | | phpmyadmin | | test |+-------- ------------+7 rows in set (0.01 sec) Select a specific database MYSQL> USE BLOg;database changed displays all tables in the current database mysql> show tables;+----------------+| tables_in_blog |+----------------+| blog_user |+----------------+1 row in set (0.00 sec) Display table field information mysql> describe blog_user;+----------+-------------- ----+------+-----+---------+----------------+| field | type | null | key | default | extra |+----------+------------------+ ------+-----+---------+----------------+| id | int (11) unsigned | no | pri | null | auto_ increment | | username | varchar (255) | YES | | | | | password | varchar (one) | YES | | NULL | |+----------+------------------+------+-----+---------+------------- ---+3 rows in set (0.00 sec) query data mysql> select * from blog_user ; +----+----------+----------+| id | username | password |+----+----------+------ ----+| 1 | admin | 123456 | | 2 | root | root |+----+-- --------+----------+2 rows in set (0.00 sec) Insert Data Mysql> insert into blog_user values ("3", "KKK", "nnn"); query ok, 1 row affected (0.00 sec) modify Data Mysql> update blog_user set password= "lll" where username= ' KKK '; query ok, 1 row affected (0.00 sec) rows matched: 1 changed: 1 warnings: 0 Exit Mysql> exitbye
Mac MySQL command line common commands