Where to install MySQL under Ubuntu needs attention.

Source: Internet
Author: User

safety loading and unloading

sudo apt-get autoremove--purge mysql-server-5.0
sudo apt-get remove Mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove Mysql-common//This is important

sudo apt-get install Mysql-server

sudo apt-get install mysql-client

sudo apt-get install Php5-mysql

Configure MySQL to allow remote connections

sudo vi/etc/mysql/my.cnf, in [mysqld] bind_address=127.0.0.1 # comment out this line, otherwise the remote connection may not connect.

GRANT all privileges the on table name. * To [e-mail protected] "%" identified by "password"; # Add a user, any host can connect
Flush privileges; # Refresh Permissions

MySQL password reset

sudo vi/etc/mysql/my.cnf, adding a line "skip-grant-tables" to the [Mysqld] Segment

sudo service mysql restart, restart MySQL services

sudo mysql-u root-p mysql, enter MySQL admin command line with a blank password

Use MySQL #切换数据库

Update user set Password=password ("New password") where user= "root"; #设置新密码

phpMyAdmin MySQL that connects multiple hosts

Modify the config.inc.php file

$i + +;
$cfg [' Servers '] [$i] [' verbose '] = ' host1 '; # The first host, verbose is the host name that is displayed
$cfg [' Servers '] [$i] [' host '] = ' localhost ';
$cfg [' Servers '] [$i] [' port '] = ';
$cfg [' Servers '] [$i] [' socket '] = ';
$cfg [' Servers '] [$i] [' connect_type '] = ' TCP ';
$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';
$cfg [' Servers '] [$i] [' user '] = ' root ';
$cfg [' Servers '] [$i] [' password '] = ';
$cfg [' Servers '] [$i] [' compress '] = true;


$i + +;
$cfg [' Servers '] [$i] [' verbose '] = ' host2 '; # Second host, verbose is the host name that is displayed
$cfg [' Servers '] [$i] [' host '] = ' x.x.x.x ';
$cfg [' Servers '] [$i] [' port '] = ';
$cfg [' Servers '] [$i] [' socket '] = ';
$cfg [' Servers '] [$i] [' connect_type '] = ' TCP ';
$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';
$cfg [' Servers '] [$i] [' user '] = ' root ';
$cfg [' Servers '] [$i] [' password '] = ';
$cfg [' Servers '] [$i] [' compress '] = true;

http://www.okbt.net/Magnetic Search Engine

Where to install MySQL under Ubuntu needs attention.

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.