Changes

Jump to navigation Jump to search

Coral: mysql change password

6,621 bytes added, 13:38, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: mysql intro|MySQL]] | [[Coral: mysql change password|Change password]] | [[Coral: mysql restore password|Restore password]] | [[Coral: mysql console|MySQL Console]] | [[Coral: mysql create delete database|Create delete Database]] | [[Coral: mysql create restricted user|Create Restricted User]] | [[Coral: mysql edit restricted user|Edit Restricted User]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MySQL - Change password</span>

There are three methods of changing the MySQL root password: by a command window, phpMyAdmin or UniController. The easiest method is to use UniController, which is fully automated. The other methods require a certain amount of typing and editing, and are more error-prone.

__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|<span style="font-size: 14px;">ยป</span>||[[Coral: mysql intro|MySQL]]
|-
|&nbsp;||[[Coral: php intro|PHP]]
|-
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}

|}
==Set New MySQL root user password using UniController==
{|
|-valign="top"
|
Change or set a new MySQL root user password.<br />
From UniController, open the menu:


<span style="padding:6px;background-color:#99FFFF"> Server Configuration > MySQL > Change Password </span>


* The Set New MySQL Password menu opens (See image on right)
* '''A)''' Enter a new password
* '''B)''' Click the '''Change Password''' button.

|
[[Image:Coral_mysql_change_root_password.gif]]
|}
The change process is automatic; the indicators show the actions taken.<br />

'''''[[#top | Top]]'''''
==Set New MySQL root user password using phpMyAdmin==
Setting a new MySQL root password using phpMyAdmin requires four root accounts to be changed along with two configuration files.<br />
Note: The following assumes the current password is '''root12''' and the new password is '''root123'''; substitute for these as appropriate.

First start both servers using UniController and then start phpMyAdmin to change the password. Proceed as follows:

{|
|-valign="top"
|
# From the top menu bar of phpMyAdmin, click the '''Privileges''' (1) button. The user privileges page opens, as shown on right:
# Click the first Edit Privileges (2) which opens a new page: "Edit Privileges: User"
#* Scroll down the page to '''Change password'''
#* Enter new root password for example root123 (6) repeat password (7)
#* Click '''Go''' (8) to unpdate the user's password
# Repeat step 2) for each remaining user (3), (4) and (5)
# Navigate to the end of the Privileges User Overview page and click '''reload the privileges''' link.

|
[[Image:Coral_mysql_rp_phpmyadmin1.gif]]
|}

'''Note:''' Do not stop the MySQL server at this point.

{|
|-valign="top"
|
<ol start="5">

<li> Edit file UniServer\uni_con\includes\'''mysql_password''' and replace the existing password (root12) with the new root password (root123).</li>
<li> Edit file UniServer\uni_con\'''config_tracker.ini'''</li>
* Navigate to section: '''[MYSQL]'''
* Change line '''password = root12''' by replacing the existing password root12 with the new root password root123.
</ol>
'''Note:''' Perform a quick test. Clear your browser's cache and restart the servers. Run phpMyAdmin and verify that the MySQL server is accessible.
|
[[Image:Coral_mysql_rp_phpmyadmin2.gif]]
|}
'''Note''': The above root user accounts all use the same root password. This is purely for convenience and one of consistency.

'''''[[#top | Top]]'''''
==Set New MySQL root user password using MySQL Console==

Setting a new MySQL root password using MySQL Console requires four root accounts to be changed along with two configuration files.<br />
'''Note:''' The following assumes the current password is '''root123''' and the new password is '''root1234'''; substitute for these as appropriate.


First start both servers using UniController and then start MySQL Console to change the password. Proceed as follows:

{|
|-valign="top"
|
# Connect to MySQL server by typing the following at the command window:<br />mysql -uroot -proot123
# At the MySQL prompt type the following:<br />
<pre>
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root1234');
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('root1234');
mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('root1234');
mysql> SET PASSWORD FOR 'pma'@'localhost' = PASSWORD('root1234');
mysql> FLUSH PRIVILEGES;
mysql> exit;
</pre><br />
Results for steps 1) and 2) are shown on right.
<ol start="3">
<li> Edit file UniServer\uni_con\includes\'''mysql_password''' and replace the existing password (root123) with the new root password (root1234).</li>
<li> Edit file UniServer\uni_con\'''config_tracker.ini'''<br />Navigate to section: '''[MYSQL]'''<br />Change line '''password = root123''' by replacing the existing password root123 with the new root password root1234.</li>
|
<pre>
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot123
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root1234');
Query OK, 0 rows affected (0.03 sec)
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('root1234');
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('root1234');
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR 'pma'@'localhost' = PASSWORD('root1234');
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.06 sec)
mysql> exit;
Bye
C:\UniServer\usr\local\mysql\bin>
</pre>
|}
'''Note:''' Perform a quick test. Clear your browser's cache and restart the servers. Run phpMyAdmin and verify that the MySQL server is accessible.

==Related topics==
[[Coral: mysql restore password|Restore MySQL root password]].

[[Coral: mysql console|MySQL Console]].


'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu