Installing MySQL in Ubuntu saves a lot of trouble. Basically, I sorted out the online materials. 1. install MySQLsudoapt-getinstallmysql-servermysql-client # You will be asked to enter the root user password sudoapt-Ubuntu once to install MySQL. I use the online installation method, saving a lot of trouble. Basically, I sorted out the online materials.
1. Install MySQL
- Sudo apt-get install mysql-server mysql-client # You will be asked to enter the root user password once in the middle
- Sudo apt-get install php5-mysql # installation php5-mysql is to connect php and mysql
After the installation is complete, the MySQL server should have started up. Manual start method:
- Sudo start mysql # start it manually
- Sudo stop mysql # manually stop
After you modify the configuration file, you need to restart mysqld to make these changes take effect.
To check whether the mysqld process is enabled, run the following command:
- Pgrep mysqld
If the process is enabled, the command returns the id of the process.
Go to MySQL
- Mysql-uroot-p
After entering the MySQL root Password, you can see the following results:
- Hadoop@ Ubuntu:~ $ Mysql-uroot-p
- Enter password:
- Welcome to the MySQL monitor. Commands end with; or \ g.
- Your MySQL connection id is62
- Server version:5.1.41-3ubuntu12.10(Ubuntu)
- Type'Help ;'Or'\ H' ForHelp. Type'\ C'To clear the current input statement.
- Mysql>
2. Install phpmyadmin
Install apache, a web server that supports PHP, and download and install phpmyadmin to manage the MySQL database on the web end.
1) install apache2
- Sudo apt-get install apache2
2) install PHP5 and Apache PHP5 modules
- Sudo apt-get install php5 libapache2-mod-php5
Restart Apache
- Sudo/etc/init. d/apache2 restart
3) install phpmyadmin
- Sudo apt-get install phpmyadmin