استفاده از فونت فارسی در mysql بصورت پیش فرض

To set the default to UTF-8, you want to add the following to my.cnf

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

ایجاد کاربر جدید در Mysql و دادن مجوز ها

mysql> create user ‘newuser’@’localhost’ identified by ‘password’;

mysql>grant all privileges on * . * to ‘newuser’@’localhost’;

mysql>flush privileges;

mysql>grant [type of permission] on [database name] . [table name] to ‘userName’@’localhost’;

mysql>revoke [type of permission] on [database name] . [table name] from ‘userName’@’localhost’;

mysql>drop user ‘userName’@’localhost’;

type of permissions: all privileges – creat – drop – delete – insert – select – update – grant option

پشتیبان گیری از دیتابیس mysql

How to Back Up MySQL Databases From The Command Line:

single database:

mysqldump database_name > database_name.sql

Multiple databases:

mysqldump --databases database_one database_two > two_databases.sql

all of the databases on a server:

mysqldump --all-databases > all_databases.sql