MySQL create databases and user from a to z

How can I create a database and an user to work together in MySQL. Well, it’s quit easy, theres the few MySQL lines you need to use to solve your problem. Create the database [cce_mysql] CREATE database my_db; [/cce_mysql] Create an user [cce_mysql] CREATE USER ‘my_user’@’localhost’ IDENTIFIED BY ‘my_pass’; [/cce_mysql] Verify user [cce_mysql] SELECT *

MySQL tables space

Well my database is starting to get bigger and bigger. So I use this small query to know which table is consuming the more space. [cc_mysql escaped=”true”] SELECT concat(table_schema, ‘.’, TABLE_NAME) AS “Tables”, table_rows AS “# of Rows”, round(((data_length + index_length) / 1024 / 1024), 2) “Size in MB” FROM information_schema.TABLES ORDER BY (data_length +