By default, MySQL’s datadir is placed in the /var/lib/mysql directory.
Create the directory that will be new datadir (ex:-/home/db)
chown the directory to the mysql:mysql user
sudo chown -R mysql:mysql /home/db/*
You need to stop the mysql server using the following command
sudo /etc/init.d/mysql stop
Now you need to edit the /etc/mysql/my.cnf file
sudo vi /etc/mysql/my.cnf
and look for “datadir = /var/lib/mysql” this si where mysql database default data directory here you need to change this one to your new directory
datadir = /home/db
copy the files from the old …
Installing Mysql database in Ubuntu
#apt-get install mysql-server mysql-client libmysqlclient12-dev
MySQL initially only allows connections from the localhost (127.0.0.1). We’ll need to remove that restriction if you wish to make it accessible to everyone on the internet. Open the file /etc/mysql/my.cnf
#vi /etc/mysql/my.cnf
Find the line bind-address = 127.0.0.1 and comment it out
…
#bind-address = 127.0.0.1
…
You can check your configuration using the following command
#netstat -tap
Output Looks like below
tcp 0 0 *:mysql *:* LISTEN 4997/mysqld
MySQL comes with no root password as default. This is a huge …