Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Windows does not display uppercase table names after authorizing users with a single table

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Problems encountered in simulated production environment

I. description of the problem:

1.Windows

2.mysql-5.7.18 version

Configuring the mysql parameter lowercasetablenames=0 cannot start after restart, so you can only choose to configure lowercasetablenames=2 (store according to format when storing, and read in lowercase when reading)

3. Build a database and build a table sentence:

Under a test database, I created a lowercase table name and an uppercase table name USER with the following statements.

(1) build a database test

Create databse test

(2) create table

DROP TABLE IF EXISTS ``; CREATE TABLE `` (`id` int (11) NOT NULL, `name` varchar (255) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8

(3) create table USER

DROP TABLE IF EXISTS `USER`; CREATE TABLE `USER` (`ID` int (11) NOT NULL, `NAME` varchar (255) DEFAULT NULL, PRIMARY KEY (`ID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8

After the construction of the 2 table structures, users are created and authorized separately.

Create user 'test'@'localhost' IDENTIFIED by' test@654321';grant all on test. to test@'localhost';grant all on test.USER to test@'localhost'

Then use the client tool Navicat, log in with the user test, and find that the table only shows the lowercase , but the uppercase USER table does not show.

Second, the solutions that have been tried:

The authorization of the table is stored in the mysql.tablespriv table. When I find the user stored in the Tablename column, it is lowercase. I manually modify it to uppercase USER and save it, restart the mysql service, and still do not display the uppercase table name.

III. Final settlement

Remove the parameters of the previous configuration lower and follow the default values of Windows. Even if you migrate from a Linux case-sensitive environment to Windows, the data in the database can be used properly.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report