Install mysql in Ubuntu and mysql in ubuntu

Source: Internet
Author: User

Install mysql in Ubuntu and mysql in ubuntu

If Mysql has been installed on the machine before, it is best to uninstall the previous content before re-installing Mysql. Otherwise, unexpected problems may occur.

/*** @ Author jenkiHuang * @ email jenkiHuang@qq.com * @ version 20150402 * // delete an existing mysql, clear residual data sudo apt-get autoremove -- purge mysql-server-5.0sudo apt-get remove mysql-serversudo apt-get autoremove mysql-server // this very important sudo apt-get remove mysql-common // install mysqlsudo apt-get install mysql-server // log on to mysqlmysql-uroot-p // restart mysqlsudo service mysql restart

 

After running the preceding command, you can log on to the mysql database locally. However, if it is developed by multiple developers in the project team, there must be multiple users connected to the database. In this way, you must modify the database configuration file.

// Remotely connect to mysqlsudo vi/etc/mysql/my. cnf // find bind-address = 127.0.0.1 // comment out this line, for example: # bind-address = 127.0.0.1 // or change to: bind-address = 0.0.0.0 // allow access from any IP address; you can also specify an IP address. // Restart MySQL: sudo/etc/init. d/mysql restart // authorize the user to remotely connect to grant all privileges on *. * to root @ "%" identified by "123456" with grant option; // refresh the permission information and the setting takes effect immediately. flush privileges;

Reprinted: http://www.jenkihuang.com/experience/2015/04/ubuntu-install-mysql.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.