change table name to upper case

前端 未结 4 851
别跟我提以往
别跟我提以往 2020-12-25 14:58

I need to change table name from lowercase to uppercase but using this statement the table name can be changed but the names are in lowercase..

sql> rena         


        
相关标签:
4条回答
  • 2020-12-25 15:28
    1. Add this line in the mysql server variables array in my.cnf:

      lower_case_table_names=2
      
    2. Restart your mysql server.

    3. Now you can create or alter tables in upper case, the server will accept your query.

    Note that usually, on Linux systems, the main mysql configuration file can be found in /etc/my.cnf or /etc/mysql/my.cnf.

    0 讨论(0)
  • 2020-12-25 15:29

    Simple

    sql> rename table name to tempName;
    sql> rename tempName name to TABLE;
    
    0 讨论(0)
  • 2020-12-25 15:35

    This should give u what you are looking for...

    ALTER TABLE oldtable RENAME TO NewTable;
    
    0 讨论(0)
  • 2020-12-25 15:44

    If you use EasyPHP (Maybe it also works for WAMP/XAMP/LAMP?) this worked for me:

    Open the following file in the EasyPHP installation folder:

    \binaries\conf_files\my.ini

    Just under the line where it is written:

    [mysqld]

    Write:

    lower_case_table_names=2

    So you'll have:

    [mysqld]

    lower_case_table_names=2

    EasyPHP will notice the change in this file and restart, but you can always manualy restart to make sure.


    You can test the variable using the command:

    SHOW VARIABLES LIKE 'lower_case_table_names';

    Or in phpMyAdmin go to: Home > Variables, and search for "lower case table names".

    0 讨论(0)
提交回复
热议问题