MySQL 5.7 – Resetting root’s password

After several upgrades of MySQL on my FreeBSD 12.1 Server and, in particular, upgrading from MySQL 5.6 to MySQL 5.7 caused the MySQL 5.7 Server not to start. Reviewing the MySQL .err log file, I decided to remove all the data under /var/db/mysql! Of course, backups and snapshots were made. After removing the data structure under /var/db/mysql, one must re-establish MySQL’s root password thus prompting this post.

Although not a great source of inspiration or knowledge presented in this post, but it is more for my recollection in the future!

Steps for resetting your MySQL instance in FreeBSD 12.1:

root@xxx:/ # service mysql-server stop
root@xxx:/ # cd /var/db/mysql/
root@xxx:/var/db/mysql # rm -Rf *
root@xxx:/var/db/mysql # sysrc mysql_args="--skip-grant-tables"
root@xxx:/var/db/mysql # service mysql-server start
root@xxx:/var/db/mysql # mysql -u root
root@localhost [(none)]> FLUSH PRIVILEGES;
root@localhost [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
root@localhost [(none)]> exit
root@xxx:/var/db/mysql # service mysql-server stop
root@xxx:/var/db/mysql # sysrc -x mysql_args="--skip-grant-tables"
root@xxx:/var/db/mysql # service mysql-server start

Checking your password:

root@xxx:/var/db/mysql # mysql -u root -p
Enter password: 'new password'
root@localhost [(none)]> exit

Summary:

It’s not very often one should feel the need to wax your MySQL Instance, but if you do, ensure backup and snapshots of the data are taken first.

Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part IV: Drupal 7 & SSL

Part IV: Drupal 7 & SSL:

The next step in the process is to use an ssl certificate to protect the connections to secure pages.  Obtaining a certificate is left to the reader to fulfill.  The author recommends obtaining an ssl certificate from a certificate authority such as verisign, godaddy, geotrust, etc. Continue reading “Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part IV: Drupal 7 & SSL”

Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part III: Drupal 7

Part III – Drupal 7:

In Part I and II, Apache, PHP, MySQL were installed and configured.  In Part III, Drupal 7 configuration is the focus.  This information can be derived from Drupal 7 installation documentation.  The reader is encouraged to review the documentation at www.drupal.org. Continue reading “Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part III: Drupal 7”

Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part I: Apache24 and PHP5

Part I – Installing Apache24 and PHP5:

An Apache, PHP, MySQL and Drupal stack on FreeBSD is not difficult to install and configure.  In this case, the Drupal installation will contain only one website and will not employ the use of virtual hosts.  So let’s get started installing Apache24 and PHP5. Continue reading “Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part I: Apache24 and PHP5”

Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part II: MySQL55 and phpMyAdmin

Managing MySQL55 with phpMyAdmin:

In Part 1 of this article, Apache24 Server and PHP5 were installed and configured.  The next step towards having a functional FAMP (FreeBSD, Apache, MySQL, PHP) Stack is to install mysql and phpmyadmin. Continue reading “Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part II: MySQL55 and phpMyAdmin”