Pre-Requisites
- I'll use Homebrew as the package manager.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Installing MySQL
- Install MySQL:
brew install mysql
- Before setting up MySQL we have to start the
brew services
brew services start mysql
Note: To stop
mysql
we setbrew services stop mysql
Setting up MySQL
Without Password
- We just type:
mysql -uroot
and our session is on, we can exit the session by typing
mysql> exit
With Password
- We type:
mysql_secure_installation
Note: ”Validate password component" needs a secure sequence of characters to set the password, this include as minimum 8 characters and other more patterns.
If we sety
(yes), it'll require that pattern, if we don't want that it, we just setn
(no).
- Recommended answers in the installation
# Remove anonymous users?:
y
#Disallow root login remotely?:
n
# Remove test database and access to it?:
y
# Reload Privilege tables now?:
y
- To start the mysql session with password we just type:
mysql -uroot -p
and it will ask the password.
Top comments (0)