1.进入数据库
lin-wangs-MacBook-Pro:~ linwang$ cd /Applications/XAMPP/xamppfiles/bin
lin-wangs-MacBook-Pro:bin linwang$ ./mysql -u root -p -h localhost
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.1.44 Source distribution
2. BUILD Database
mysql> Creat DATABASE userdatabase;
mysql> use userdatabase;
Database changed
mysql> show tables;
+------------------------+
| Tables_in_userdatabase |
+------------------------+
| user |
+------------------------+
1 row in set (0.00 sec)
mysql> select * from user;
+---------+----------------------------------+-----------+-----------+
| name | password | timestamp | publickey |
+---------+----------------------------------+-----------+-----------+
| linwang | 7da8450afe6c850de86ed347fe14a16f | 0 | |
+---------+----------------------------------+-----------+-----------+
1 row in set (0.00 sec)
mysql> describe user;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| name | varchar(255) | NO | PRI | NULL | |
| password | varchar(255) | NO | | NULL | |
| timestamp | varchar(255) | NO | | NULL | |
| publickey | text | NO | | NULL | |
+-----------+--------------+------+-----+---------+-------+
4 rows in set (0.08 sec)