mysql

How to connect to remote MySql server

Submitted by admin on Sun, 02/18/2018 - 16:49

To do so you should enable connection from the remote server.

In DirectAdmin:

go to "MySQL Management"  and click on each domain name you want to have access remotely, in section "Access Hosts" below the page you should add the IP address of the remote server and then click on the "Add Host" button.

 

In command line:

login to your MySQL console with root access

mysql -u root -p

then run the following command:

How to backing up database by its table and restore them to new database

Submitted by admin on Thu, 02/15/2018 - 12:30

for creating separated files for each table:

for x in `mysql --skip-column-names -u <source_username> -p<source_password> <source_database_name> -e 'show tables;'`;
do
     echo "file=$x"
     mysqldump -u <source_username> -p<source_password> <source_database_name> $x > "$x.sql"
done

 

for restoring all .sql files that we have been created in the previous step to our new database

Linux Server .conf Files Directory

Submitted by admin on Tue, 08/02/2016 - 19:37

Default options are read from the following files in the given order:


Default options are read from the following files in the given order:
/etc/my.cnf
/etc/mysql/my.cnf
/usr/etc/my.cnf
~/.my.cnf

restarting mysql or mysqld services


service mysqld start
service mysqld stop
service mysqld restart