8 月 232020
 

Source: WP_Options table in MySQL db is over 1.1GB – how can I reduce the size?

If this article is of any help, it suggests deleting the cached “transient” data:

DELETE FROM wp_options WHERE option_name LIKE '_transient_%';

As with any major database operation, before you do this make sure you have backups and that you’ve tested these backups work.

12 月 212015
 

Source: How can I export the privileges from MySQL and then import to a new server?

I know how to export/import the databases using mysqldump & that’s fine but how do I get the privileges into the new server.

For extra points, there are a couple of existing databases on the new one already, how do I import the old servers privileges without nuking the couple existing of ones.

Old server: 5.0.67-community

New server: 5.0.51a-24+lenny1

EDIT: I’ve got a dump of the db ‘mysql’ from the Old Server & now want to know the proper way to merge with the ‘mysql’ db on the New Server.

I tried a straight ‘Import’ using phpMyAdmin and ended up with an error regarding a duplicate (one that I’ve already migrated manually).

Anyone got an elegant way of merging the two ‘mysql’ databases?

Continue reading »

12 月 012015
 

Source: InnoDB Corruption Repair Guide

Understanding that our ability as technicians to responsibly assist with InnoDB corruption is very limited, I wanted to offer a basic guide that goes over some of the methods you can use to deal with some of the most common InnoDB corruption issues, from start to finish. It is fairly lengthy, so to skip sections, you can use your browser’s Find to search for the sections by their identifier as shown below (/A/, /B/, /C/).

Continue reading »

7 月 172015
 

Source: Using a .php file to generate a MySQL dump – Stack Overflow

Here’s the information I have:

I am working with a Linux based system using MySQL and PHP5. I need to be able to generate a mysqldump from within a .php file, and then have that dump be stored in a file on the server in a location I would specify.

As I’m a PHP nooblet, I’d like someone to give me some assistance, guidance, or code, that would do what I require. This would have to be run remotely from the Internet.

Continue reading »

11 月 142014
 

原文(source): sql – MySql export schema without data – Stack Overflow

You can do with the –no-data option with mysqldump command

mysqldump -u root -p --no-data dbname > schema.sql

 

3
IMHO, mysqldump is the best answer. MySQL Administrator is abandoned and MySQL Workbench is still quite buggy. –  Álvaro G. Vicario May 30 ’11 at 11:35
5
Also consider using the --single-transaction option if you don’t want or can’t do table locks. –  Jim Jan 22 ’13 at 21:55
-d is –no-data for short. –  marstone Oct 8 at 17:15
8 月 142014
 

原文(source): MySQL 用 MySQLDump 備份 InnoDB 注意事項 | 小惡魔 – 電腦技術 – 工作筆記 – AppleBOY

大家在備份 MySQL 資料庫時一定是使 mysqldump 指令,不管是 MyISAM 或 InnoDB 都一樣, 在處理 InnoDB 格式備份時使用 mysqldump -single-transaction,但是你會發現在大多的備份狀況都是 OK 的,只是有時候會發現有的資料表只有備份到 structure 而無備份到 Data?

Continue reading »