In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How to set the table name by mysql under Linux? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
Under Linux, mysql can modify the table name through the "ALTER TABLE old table name RENAME [TO] new table name;" statement; you can also configure the my.cnf file to change the value of the "lower_case_table_names" option to "1" to set the table name to be case-insensitive.
(recommended tutorial: mysql video tutorial)
Set the table name of mysql under Linux
In MySQL, you can use the ALTER TABLE statement to modify the table name.
In MySQL, you can use ALTER TABLE statements to change the structure of the original table, such as adding or deleting columns, changing the original column type, renaming columns or tables, and so on.
The grammar rules are as follows:
ALTER TABLE RENAME [TO]
Among them, TO is an optional parameter, and whether it is used or not does not affect the result.
Example
Use ALTER TABLE to rename the datasheet student to the tb_students_info,SQL statement and run the result as shown below.
Mysql > ALTER TABLE student RENAME TO tb_students_info;Query OK, 0 rows affected (0.01 sec) mysql > SHOW TABLES;+-+ | Tables_in_test | +-+ | tb_students_info | +-+ 1 row in set (0.00 sec)
Tip: changing the table name does not change the structure of the table, so the structure of the table after the name change is the same as that before the name change. Users can use the DESC command to view the modified table structure
Mysql setting table names under Linux are not case-sensitive
MySQL under Linux is case-sensitive by default.
You can make MySQL insensitive to table name case by setting as follows:
1. Log in with root and modify / {mysql installation path} / etc/my.cnf
2. Under the [mysqld] node, add a line: lower_case_table_names=1
3. Restart MySQL.
/ bin/systemctl restart mysql.service Thank you for your reading! After reading the above, do you have a general understanding of the method of setting table names in mysql under Linux? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.