* You are viewing the archive for the ‘MySql Interview Questions’ Category

MySql Interview Questions Part-II

How do you start and stop MySQL on Windows? – net start MySQL, net stop MySQL
How do you start MySQL on Linux? – /etc/init.d/mysql start
Explain the difference between mysql and mysqli interfaces in PHP? – mysqli is the object-oriented version of mysql library functions.
What’s the default port for MySQL Server? – 3306
What does tee command do in MySQL? – tee followed by a filename turns on MySQL logging to a specified file. It can be stopped by command notee.
Can you save your connection settings to a conf file? – Yes, and name it ~/.my.conf. You might want to change the permissions on the file to 600, … Continue Reading

MySql Interview Questions Part-I

Q:1 How can we take a backup of a MySQL table and how can we restore it. ?
A:1 To backup:
BACKUP TABLE tbl_name[,tbl_name…] TO ‘/path/to/backup/directory’
RESTORE TABLE tbl_name[,tbl_name…] FROM ‘/path/to/backup/directory’
mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table.
-t, –no-create-info
Don’t write table creation information (the CREATE TABLE statement).
-d, –no-data
Don’t write any row information for the table. This is very useful if you just want to get a … Continue Reading