Category Archives: Sql Blog

My Sql Questions And Answers

Welcome To Mysql Questions And Answers

Learn More Complex Questions & Answers Related to Mysql & Sql .

Coming soon!!

How to select database using command line in Mysql

Use the following command to select database using command line in Mysql.

1 . Grant Permission

GRANT ALL PRIVILEGES ON `database_name`.* TO 'username'@'localhost'WITH GRANT OPTION;

2 . Now Select Database

Use database_name;

you will be switch to this database.

How to import database using command line in MySQL

How to import database using command line in MySQL

Use the following command to import database using command line in MySQL :

mysql -u username -p password database_name < physical location of the file

Another very simple example :

mysql > Use database_name;

mysql> source C:\Users\mydatabase.sql(path of the file you want to import);

How to update row using joins in MYSQL | to updtae row ,data using joins in sql

You can update row using joins in MYSQL as follows :

 

update TABLE_1 join TABLE_2  on   TABLE_1.id=TABLE_2.user_id SET  TABLE_1.name =”Test”  where TABLE_2.user_id=’12’ ;

 

Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation

Problem is related to character sets & collation type of table so

simply change the table charater set & collation type

Use the following command :

alter table <table_name> convert to character set utf8 collate utf8_unicode_ci;

 

or you can chage it manually :

Go to option> and then go to option > Table Options > Collation

Change it to  ” utf8_unicode_ci ”

your problem is solved

.

chageItto-UTF8