Select the database to be operated
To operate a database, you must first select the database, otherwise an error will be prompted:
ERROR 1046(3D000): No database selected
Two ways to use the database:
One: Specify when logging in to the database, command: mysql -D selected database name -h host name -u user name -p
For example, when logging in, select the database you just created: mysql -D samp_db -u root -p
2: Use the use statement to specify after logging in, command: use database name;
use The statement can be made without semicolon. Execute use samp_db to select the database just created. After the selection is successful, it will prompt: Database changed
The above is the content of using MySQL database (3) to select the database to be operated. More related Please pay attention to the PHP Chinese website (www.php.cn) for content!