Home >Operation and Maintenance >Linux Operation and Maintenance >How to log in to mysql on linux
Linux is a Unix-like operating system that is free to use and spread freely. It is a multi-user, multi-task, multi-thread and multi-CPU operating system based on POSIX and UNIX. It can run major UNIX software tools, applications and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the network-centric design philosophy of Unix and is a multi-user network operating system with stable performance.
MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently a product of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is one of the best RDBMS (Relational Database Management System) application software.
How to log in to mysql on Linux?
Mysql login method is like this:
[root@crmtestdb root]#mysql -u root -h 127.0.0.1 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.0.45-community MySQL Community Edition (GPL) Type ''help;'' or ''\h'' for help. Type ''\c'' to clear the buffer. mysql>
If there is a password, the login method is:
mysql -u root -h 127.0.0.1 -p
As for which database to use, which one should be used? This is it:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | | wt | +--------------------+ 4 rows in set (0.00 sec) mysql> use test Database changed mysql>
The above is the detailed content of How to log in to mysql on linux. For more information, please follow other related articles on the PHP Chinese website!