mysql-management

Mysql - Rename all tables and columns to lower case?

巧了我就是萌 提交于 2019-11-29 08:36:10
问题 I recently transferred a database from a windows box to a linux box. The tables are mixed between lower and upper case names. I need a way to rename all tables and columns to lowercase. Is that possible? I see in this SO answer it's possible for tables, but have not found anything that deals with column names. 回答1: You can try to do exact same thing with Information_Schema.Columns table EDIT: Something like SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CHANGE `', COLUMN_NAME, '` `', LOWER

Mysql show processlist lists many processes sleep and info = null?

拜拜、爱过 提交于 2019-11-29 03:46:08
I'm injecting a stress test into my web app that connects to a mysql server and I'm monitoring the show processlist of mysql. When the load is high (high swap i/o) I get many processes like that: | 97535 | db| localhost | userA | Sleep | 515 | | NULL | 97536 | db| localhost | userA | Sleep | 516 | | NULL | 97786 | db| localhost | userA | Sleep | 343 | | NULL | 97889 | db| localhost | userA | Sleep | 310 | | NULL But I can't understand why are they still there and are not killed? This eventually leads to my app using all max_connections and stop processing incoming requests... Any idea what are

MySQL server's thread_stack parameter - what is it? How big should it be?

孤人 提交于 2019-11-28 02:46:52
问题 Couple days ago I got following error from MySQL database: Thread stack overrun: 68744 bytes used of a 196608 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack. All documentation that I found says, that: The default is 64KB before MySQL 4.0.10 and 192KB thereafter. If the thread stack size is too small, it limits the complexity of the SQL statements that the server can handle, the recursion depth of stored procedures, and other memory-consuming

Mysql show processlist lists many processes sleep and info = null?

£可爱£侵袭症+ 提交于 2019-11-27 17:47:57
问题 I'm injecting a stress test into my web app that connects to a mysql server and I'm monitoring the show processlist of mysql. When the load is high (high swap i/o) I get many processes like that: | 97535 | db| localhost | userA | Sleep | 515 | | NULL | 97536 | db| localhost | userA | Sleep | 516 | | NULL | 97786 | db| localhost | userA | Sleep | 343 | | NULL | 97889 | db| localhost | userA | Sleep | 310 | | NULL But I can't understand why are they still there and are not killed? This

How to set root password to null

不打扰是莪最后的温柔 提交于 2019-11-27 02:48:42
How can I change the password for root user of MySQL to null -- meaning no password or '' -- from the MySQL command line client? Vladislav Rastrusny You can recover MySQL database server password with following five easy steps. Step # 1 : Stop the MySQL server process. Step # 2 : Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password. Step # 3 : Connect to mysql server as the root user. Step # 4 : Setup new mysql root account password i.e. reset mysql password. Step # 5 : Exit and restart the MySQL server. Here are commands

ERROR 1396 (HY000): Operation CREATE USER failed for 'jack'@'localhost'

左心房为你撑大大i 提交于 2019-11-26 11:32:46
I seem to be unable to re-create a simple user I've deleted, even as root in MySQL. My case: user 'jack' existed before, but I deleted it from mysql.user in order to recreate it. I see no vestiges of this in that table. If I execute this command for some other, random username, say 'jimmy', it works fine (just as it originally did for 'jack'). What have I done to corrupt user 'jack' and how can I undo that corruption in order to re-create 'jack' as a valid user for this installation of MySQL? See example below. (Of course, originally, there was much time between the creation of 'jack' and his

ERROR 1396 (HY000): Operation CREATE USER failed for 'jack'@'localhost'

只愿长相守 提交于 2019-11-26 02:27:35
问题 I seem to be unable to re-create a simple user I\'ve deleted, even as root in MySQL. My case: user \'jack\' existed before, but I deleted it from mysql.user in order to recreate it. I see no vestiges of this in that table. If I execute this command for some other, random username, say \'jimmy\', it works fine (just as it originally did for \'jack\'). What have I done to corrupt user \'jack\' and how can I undo that corruption in order to re-create \'jack\' as a valid user for this