MySQL Flashcards

1
Q

How do you start MySQL on Linux?

A

/etc/init.d/mysql start

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the difference between mysql and mysqli interfaces in PHP?

A

mysqli is the object-oriented

version of mysql library functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does tee command do in MySQL?

A

tee followed by a filename turns on MySQL logging to a specified
file. It can be stopped by command notee.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you change a password for an existing user via mysqladmin?

A

mysqladmin -u root -p password

“newpassword” or mysql command: set password for ‘username’@’localhost’ = password(‘newpassword’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Use mysqldump to create a copy of the database?

A

mysqldump -h mysqlhost -u username -p

mydatabasename > dbdump.sql

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain advantages of InnoDB over MyISAM?

A

Row-level locking, transactions, foreign key constraints and crash recovery.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain advantages of MyISAM over InnoDB?

A

Much more conservative approach to disk space
management - each MyISAM table is stored in a separate file, which could be compressed then with myisamchk if needed. With InnoDB the tables are stored in tablespace, and not much further optimization is possible. All data except for TEXT and BLOB can occupy 8,000 bytes at most. No full text indexing is available for InnoDB. InnoDB COUNT(*)s execute slower than in MyISAM due to tablespace complexity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain federated tables.

A

Introduced in MySQL 5.0, federated tables allow access to the tables located on other
databases on other servers. CREATE TABLE t1 ( a int, b varchar(32)) ENGINE=FEDERATED
CONNECTION=’mysql://user@hostname/test/t1’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly