https://wiki.uniformserver.com/index.php?title=Coral:_mysql_change_password&feed=atom&action=historyCoral: mysql change password - Revision history2024-03-29T12:25:28ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=Coral:_mysql_change_password&diff=6180&oldid=prevRic: 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..."2011-11-12T13:38:09Z<p>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..."</p>
<p><b>New page</b></p><div><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><br />
<br />
{|style="margin-top:5px;"<br />
|-valign="top"<br />
|<br />
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MySQL - Change password</span><br />
<br />
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.<br />
<br />
__TOC__<br />
<br />
|<br />
{| 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;"<br />
|-<br />
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral<br />
|-<br />
|&nbsp;||[[Coral: Introduction|Home]]<br />
|-<br />
|&nbsp;||[[Coral: start quick start|Quick Start]]<br />
|-<br />
|&nbsp;||[[Coral: general intro|General]]<br />
|-<br />
|&nbsp;||[[Coral: apache intro|Apache]]<br />
|-<br />
|<span style="font-size: 14px;">ยป</span>||[[Coral: mysql intro|MySQL]]<br />
|-<br />
|&nbsp;||[[Coral: php intro|PHP]]<br />
|-<br />
|&nbsp;||[[Coral: msmtp intro|MSMTP]]<br />
|-<br />
|&nbsp;||[[Coral: cron intro|CRON]]<br />
|-<br />
|&nbsp;||[[Coral: dtdns intro|DtDNS]]<br />
|-<br />
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]<br />
|-<br />
|&nbsp;||[[Coral: perl intro|Perl]]<br />
|-<br />
|&nbsp;||[[Coral: index main|Main Index]]<br />
|}<br />
<br />
|}<br />
==Set New MySQL root user password using UniController==<br />
{|<br />
|-valign="top"<br />
|<br />
Change or set a new MySQL root user password.<br /><br />
From UniController, open the menu:<br />
<br />
<br />
<span style="padding:6px;background-color:#99FFFF"> Server Configuration > MySQL > Change Password </span><br />
<br />
<br />
* The Set New MySQL Password menu opens (See image on right)<br />
* '''A)''' Enter a new password<br />
* '''B)''' Click the '''Change Password''' button.<br />
<br />
|<br />
[[Image:Coral_mysql_change_root_password.gif]]<br />
|}<br />
The change process is automatic; the indicators show the actions taken.<br /><br />
<br />
'''''[[#top | Top]]'''''<br />
==Set New MySQL root user password using phpMyAdmin==<br />
Setting a new MySQL root password using phpMyAdmin requires four root accounts to be changed along with two configuration files.<br /><br />
Note: The following assumes the current password is '''root12''' and the new password is '''root123'''; substitute for these as appropriate.<br />
<br />
First start both servers using UniController and then start phpMyAdmin to change the password. Proceed as follows:<br />
<br />
{|<br />
|-valign="top"<br />
|<br />
# From the top menu bar of phpMyAdmin, click the '''Privileges''' (1) button. The user privileges page opens, as shown on right:<br />
# Click the first Edit Privileges (2) which opens a new page: "Edit Privileges: User"<br />
#* Scroll down the page to '''Change password'''<br />
#* Enter new root password for example root123 (6) repeat password (7)<br />
#* Click '''Go''' (8) to unpdate the user's password<br />
# Repeat step 2) for each remaining user (3), (4) and (5)<br />
# Navigate to the end of the Privileges User Overview page and click '''reload the privileges''' link.<br />
<br />
|<br />
[[Image:Coral_mysql_rp_phpmyadmin1.gif]]<br />
|}<br />
<br />
'''Note:''' Do not stop the MySQL server at this point.<br />
<br />
{|<br />
|-valign="top"<br />
|<br />
<ol start="5"><br />
<br />
<li> Edit file UniServer\uni_con\includes\'''mysql_password''' and replace the existing password (root12) with the new root password (root123).</li><br />
<li> Edit file UniServer\uni_con\'''config_tracker.ini'''</li><br />
* Navigate to section: '''[MYSQL]'''<br />
* Change line '''password = root12''' by replacing the existing password root12 with the new root password root123.<br />
</ol><br />
'''Note:''' Perform a quick test. Clear your browser's cache and restart the servers. Run phpMyAdmin and verify that the MySQL server is accessible.<br />
|<br />
[[Image:Coral_mysql_rp_phpmyadmin2.gif]]<br />
|}<br />
'''Note''': The above root user accounts all use the same root password. This is purely for convenience and one of consistency.<br />
<br />
'''''[[#top | Top]]'''''<br />
==Set New MySQL root user password using MySQL Console==<br />
<br />
Setting a new MySQL root password using MySQL Console requires four root accounts to be changed along with two configuration files.<br /><br />
'''Note:''' The following assumes the current password is '''root123''' and the new password is '''root1234'''; substitute for these as appropriate.<br />
<br />
<br />
First start both servers using UniController and then start MySQL Console to change the password. Proceed as follows:<br />
<br />
{|<br />
|-valign="top"<br />
|<br />
# Connect to MySQL server by typing the following at the command window:<br />mysql -uroot -proot123<br />
# At the MySQL prompt type the following:<br /><br />
<pre><br />
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root1234');<br />
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('root1234');<br />
mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('root1234');<br />
mysql> SET PASSWORD FOR 'pma'@'localhost' = PASSWORD('root1234');<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit;<br />
</pre><br /><br />
Results for steps 1) and 2) are shown on right.<br />
<ol start="3"><br />
<li> Edit file UniServer\uni_con\includes\'''mysql_password''' and replace the existing password (root123) with the new root password (root1234).</li><br />
<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><br />
|<br />
<pre><br />
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot123<br />
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root1234');<br />
Query OK, 0 rows affected (0.03 sec)<br />
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('root1234');<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('root1234');<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql> SET PASSWORD FOR 'pma'@'localhost' = PASSWORD('root1234');<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql> FLUSH PRIVILEGES;<br />
Query OK, 0 rows affected (0.06 sec)<br />
mysql> exit;<br />
Bye<br />
C:\UniServer\usr\local\mysql\bin><br />
</pre><br />
|}<br />
'''Note:''' Perform a quick test. Clear your browser's cache and restart the servers. Run phpMyAdmin and verify that the MySQL server is accessible.<br />
<br />
==Related topics==<br />
[[Coral: mysql restore password|Restore MySQL root password]].<br />
<br />
[[Coral: mysql console|MySQL Console]]. <br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 8-Coral]]</div>Ric