time:2025-02-07 16:02:34 Review Insights
mysql to check the database size
In MySQL, you can view the database size in the following ways:
1. Query the size of the entire database: You can use the following code: 'select concat(round(sum(sum(DATA_LENGTH/1024/1024),2),\'MB\') as data from information_schema. TABLES`。 This will return the size of the entire database, converted to MB.
2. Query the size of a database: You can use the following code: 'select concat(round(sum(DATA_LENGTH/1024/1024),2),\'MB\') as data from information_schema. TABLES where table_schema = \'testdb\'`。 This will return the size of the specified database.
3. To check the size of a table in the database, you can use the following code: 'select concat(round(sum(sum(DATA_LENGTH/1024/1024),2),\'MB\') as data from information_schema. TABLES where table_schema = \'testdb\' and table_name = \'test_a\'`。 This returns the size of a table in the specified database.
4. Check the table starting with test in the mysql database, all storage sizes: you can use the following code: 'select concat(round(sum(sum(DATA_LENGTH/1024/1024),2),\'MB\') as data from information_schema. TABLES where table_schema = \'testdb\' and table_name like \'test%\'`。 This will return the size of all tables in the specified database that start with test.
All of the above queries require the use of a information_schema database, which holds information from other databases.
《MySQL to view the database size》 This does not represent the views of this website. If there is any infringement, please contact us to delete it.
Latest article
The phone is automatically muted at 11 p.m
0x407 Remote Desktop
What should I do if the WeChat music notification bar can't be turned off
kettle configures the database connection pool
iPhone 14 Pro WeChat setting font method introduction
iPhone 14 Pro Max Removal Custom Wallpaper Tutorial
How many times can the iQOO 12 Pro zoom in for photos
How to turn off Apple Photo Auto Optimize
What to do if the power button of the mobile phone is too sensitive, it will turn off when you touch it
Huawei MateX3 lost how to get back
What is BSCI certification, which certifications are audited
Jingdong Double 11 iPhone 13 601 yuan coupon collection method introduction
Jingsamei's air conditioner is not genuine
Does the Honor Magic5 Ultimate have Dolby sound?
OnePlus Ace2app flashback how to solve
Huawei has phones with no Dimensity processor
Does the Redmi Note 12 support full Netcom
Which is the hard disk mode to install win10
How do I know if my car has a tracker?
Why should you return the optical modem for single broadband cancellation?
Recommend
Ranking
Tech Beyond