Installing mysql on FreeBSD.
# Updates the pkg archive.
# mysql installs client and server.
# Create password database.
# Grant permissions to the mysql folder.
# To activate the automatic mysql service when starting the system.
# run mysql server.
# Changing the root password.
# Opening the root account to other ip addresses.
# xxx : it's your password.
# Updates the pkg archive.
Bash:
pkg update -f
# mysql installs client and server.
Bash:
pkg install mysql56-client mysql56-server
# Create password database.
Bash:
pwd_mkdb -p /etc/master.passwd
# Grant permissions to the mysql folder.
Bash:
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
# To activate the automatic mysql service when starting the system.
Bash:
echo 'mysql_enable="YES"' >> /etc/rc.conf
# run mysql server.
Code:
service mysql-server start
# Changing the root password.
Bash:
mysqladmin -uroot -p password
Enter password: <leave the line blank here.>
New password: <enter your new password.>
Confirm new password: <confirm to enter your new password.>
# Opening the root account to other ip addresses.
# xxx : it's your password.
SQL:
mysql -p
CREATE USER 'root'@'%' IDENTIFIED BY 'xxx';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
flush privileges;
quit;


