NOTE: We are in the process of modifying the configuration for many Bitnami stacks. On account of these changes, the file paths and commands stated in this guide may change depending on whether your Bitnami stack uses MySQL or MariaDB. To identify which database server is used in your stack, run the command below:
The output of the command indicates which database server (MySQL or MariaDB) is used by the installation, and will allow you to identify which guides to follow in our documentation for common database-related operations.
Change the MySQL root password
NOTE: When setting a new password, avoid the use of special characters or quotes, as this can sometimes cause issues when accessing the database through shell scripts.
Native Package Installer, which uses the native macOS installer (DMG) to walk you through the installation of MySQL. For more information, see Chapter 2, Installing MySQL on macOS Using Native Packages. Installdirmysqlbinmysqladmin.exe -p -u root password NEWPASSWORD Reset the MySQL root password Linux and Mac OS X. If you don’t remember your MySQL root password, you can follow the steps below to reset it to a new value: Create a file in /tmp/mysql-init with the content shown below (replace NEWPASSWORD with the password you wish to use.
Linux and Mac OS X
You can modify the MySQL password using the following command at the shell prompt. Replace the NEW_PASSWORD placeholder with the actual password you wish to set.
Windows
You can modify the MySQL password using the following command at the shell prompt. Replace the NEW_PASSWORD placeholder with the actual password you wish to set.
Reset the MySQL root password
Linux and Mac OS X
If you don’t remember your MySQL root password, you can follow the steps below to reset it to a new value:
- Create a file in /tmp/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use).If your stack ships MySQL v8.x, use this content:If your stack ships MySQL v5.7.x, use this content:If your stack ships MySQL v5.6.x or earlier, use this content:TIP: Check the MySQL version with the command installdir/mysql/bin/mysqladmin --version or installdir/mysql/bin/mysqld --version
- Stop the MySQL server:
- Start MySQL with the following command:If your stack ships MySQL v8.x, use this command:If your stack ships an older version of MySQL, use this command:
- Restart the MySQL server:
- Remove the script:
Windows
If you don’t remember your MySQL root password, you can follow the steps below to reset it to a new value:
- Stop the MySQL server using the graphic manager tool. Learn how to start or stop the services.
- Check the MySQL version:
- Create a file named mysql-init.txt with the content shown below depending on your MySQL version (replace NEW_PASSWORD with the password you wish to use):
- MySQL 5.7.x or MySQL 8.x:
- MySQL 5.6.x or earlier:
- Start MySQL server with the following command. Remember to replace PATH with the location in which you have saved the mysql-init.txt file:If your stack ships MySQL v8.x, use this command:If your stack ships an older version of MySQL, use this command:
- The --init file option is used by the server for executing the content of the mysql-init.txt file at startup, it will change each root account password.
- The --defaults-file option is specified since you have installed MySQL using the Bitnami installer.
- The --console option (optional) has been added in order to show the server output at the console window rather than in the log file.
- After some minutes, hit Ctrl-C to force the shutdown.
- Restart the MySQL server from the graphic manager tool.
- After the server has restarted successfully, delete the mysql-init.txt file.
If you need to do anything with SQL on a Mac, you need an SQL admin tool. Here’s a quick run-down of four of the most popular SQL tools for Mac.
MySQL Workbench
- Mac / Linux / Windows
- feature-rich: SQL syntax-highlighting, visual database design
- Import and export to .sql, databse migration features
- Cons: complains when used to connect to MariaDB. Seems to work fine apart from annoying pop-up notices when connecting to a MariaDB server.
- License: free
Overall: Mature, many-featured admin tool suited to DBAs and developers, but might be overkill for most developers, and doesn’t like connecting to MariaDB.
PhpMyAdmin
If you’ve ever used MAMP, you will have seen PHPMyAdmin. It’s a web app interface to mySQL, and can be confiured to connect to a local MySQL or a remote server.
- Mature PHP web app
- Flexible import (SQL) and export (SQL, CSV, XLS)
- Suitable for general development, especially with a local MySQL server
- Cons: subject to web app limitations: importing large files is limited by PHP & web server upload configs. Also session timeouts require an occasional browser refresh
- License: GNU / free
Overall: a good option for general use, more suited to connecting to a local MySQL server.
Do it in Terminal
Nothing wrong with doing it the old-fashioned way.
- Built in to every mac: nothing to download
- Terminal tools support both MySQL and MariaDB
- Scriptable in bash, can also accept piped and redirected input
- Cons: typing can become annopying, so you might need to have a separte text file of commonly used commands
- License: free
Sequel Pro
- Native Mac app
- Flexible import (SQL, CSV) and export (SQL, CSV, XML, DOT)
- Cons: doesn’t feature performance info
- License: Donationware.
Overall: Good, free native Cocoa app. Recommended for general use, especially if you’re using MariaDB.
![Mac Mac](/uploads/1/1/8/3/118302760/700329458.jpg)
Mysql Admin For Mac Shortcut
So which is best?
Mysql Admin For Mac High Sierra
I use Sequel Pro daily, and MySQL Workbench sometimes, and occasionally the Terminal app too. I find Sequel Pro good to use becuase it’s uncluttered, so that’s a good choice for most devs.