Modify the MySQL default password and port for XAMPP

Source: Internet
Author: User
Tags phpmyadmin

Modify MySQL default password

MySQL "root" user default state is no password, so in PHP you can use mysql_connect ("localhost", "root", "") to connect to the MySQL server;
If you want to set a password for the "root" user in MySQL, use the "mysqladmin" command in the console. For example:

Under the Windows version of XAMPP:
\...\xampp\mysql\bin\mysqladmin-u root-p Password New password

After running, you will be prompted for the old password, and if it is correct, the newly entered password will be modified immediately.

The Linux version of XAMPP is the following command:

/opt/lampp/bin/mysqladmin-u root-p Password New password

Modify phpMyAdmin's MySQL password

Note that after you change the root password, do not forget to change the information in the PHPMyAdmin. Under \...\xampp\phpmyadmin\, search for "config.inc.php" and edit the following lines:

$cfg [' Servers '] [$i] [' user '] = ' root '; MySQL SuperUser
$cfg [' Servers '] [$i] [' auth_type '] = ' http '; HTTP MySQL authentification

From now on, you need to enter the "root" password correctly to start PHPMyAdmin

Modifying the MySQL port of phpMyAdmin

If you modified the default port 3306 for MySQL, you would modify the phpMyAdmin directory under libraries under Configuration file config.default.php. $cfg [' Servers '] [$i] [' port '] = ' This comment indicates that the null representation is using the default port 3306 for MySQL. Just change it to: $cfg [' Servers '] [$i] [' port '] = ' 3307 ';

Modify the MySQL default password and port for XAMPP

Related Article

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.