Tag Archive for 'MySQL'

MySQL Dump


Collection of some MySQL commands, very useful to create and restore MySQL-Backups. Continue reading ‘MySQL Dump’

MySQL: Error 1016 when using LOCK TABLES

I run a nightly mysqldump of all my databases and one of them has over 500 tables, mysqldumper bring me a error while processing this huge database: Continue reading ‘MySQL: Error 1016 when using LOCK TABLES’

Access denied for user ‘debian-sys-maint’


While trying to start or stop MySQL I get:

1
Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

Dabian has a own way to login to the MySQL database the credantials are listed in a file:

1
2
3
4
cat /etc/mysql/debian.cnf
[...]
user = debian-sys-maint
password = bodCNLUx0GGYm6F

Logon:

1
mysql -u root -p

Execute:

1
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'bodCNLUx0GGYm6F' WITH GRANT OPTION;

By the way set a new root passwort:

1
mysqladmin -u root password 'new-password'

MySQL Error Codes

Sometimes you need a good reference, and this is one of those times. MySQL’s perror command returns many error codes, and I’ve provided a listing here. To find errors individually, just run:

1
2
# perror 28
OS error code  28:  No space left on device

Continue reading ‘MySQL Error Codes’

Show MySQL restore progress

Sometimes if I work with really huge MySQL databases, I miss the progress bar of the restore progress.
I found a little solution to see the progress Bar

Description:
pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

1
2
pv database.sql | mysql -D databasename -pyourpassword
948.4MB 0:00:03 [22.7MB/s] [=====>               ] 21% ETA 0:00:11