Socket
Socket
Sign inDemoInstall

@rgwch/normalize_mysqldb

Package Overview
Dependencies
331
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rgwch/normalize_mysqldb

Normalize a MariaDB or Mysql database


Version published
Maintainers
1
Install size
8.10 MB
Created

Readme

Source

About

This utility normalizes a MariaDB or Mysql database. This means it will convert all table names and all column names to lowercase.

The rationale is: Mysql (and MariaDB) treat table names and field names case insensitive while some tools treat them case sensitive. In older databases, sometimes we are confronted with fields where some clients use "Somefieldname", some prefer "SomeFieldName", others "somefieldname" or even "SOMEFIELDNAME" for the same field. This leads to confusion when we apply ORM tools in case sensitive languages.

To reduce such confusion, we radically convert all to lowercase. This conforms to mysql recommendations.

Install

npm install -g normalize_mysqldb

Precautions

On case sensitive file systems, MyIsam table names are case sensitive by default. To avoid this, you should apply the following setting in my.cfg :

lower_case_table_names=1

after running normalize_mysqldb and restart the mysql server. (Do not apply the setting before normalizing, since mixed case table names won't be accessible any more then.)

Usage

normalize_mysqldb -u username -p password -d database -h hostname

WARNING The tool will immediately convert the database. So, if you're not sure: Use it only on a database copy.

Troubleshoot

On some newer Mysql-Servers (>=8) you might encounter an error message simililar to the following:

Client does not support authentication protocol requested by server, consider upgrading mysql client

Probably this error will go away, as npm-mysql2 upgrades to the newer protocol. Until then you can do the following:

From the mysql client commandline enter:

ALTER USER my_username@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password';
flush privileges;

After that, normalize_mysqldb should work for the user my_username with the password my_password.

License

MIT

Keywords

FAQs

Last updated on 26 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc