The Specified key was too long max key length is 1000 prompt is displayed when the mysql database is created.

Source: Internet
Author: User

The index field is too long,
1. Modify the Field Length
2. Modify the default storage engine of mysql.
Add default-storage-engine = INNODB under [mysqld] of/etc/mysql/my. cnf
However, the INNODB engine must be used for database creation.
SQL code
Copy codeThe Code is as follows:
Create table 'acs '(
...
) ENGINE = InnoDB default charset = utf8;

Check the current engine
Copy codeThe Code is as follows:
Mysql> show engines;

No InnoDB
Check whether dynamic loading is supported. The important line is have_dynamic_loading. If YES, continue.
Copy codeThe Code is as follows:
Mysql> show variables like "have _ % ";

Install plug-ins
Copy codeThe Code is as follows:
Mysql> install plugin innodb soname 'Ha _ innodb. so ';
Mysql> show engines;

The first time I used Mysql to create a database in Mysql, I was very confused with Oracle. Next I will briefly introduce the process of creating a database in Linux Mysql.
# Mysql

> Create user 'bob' @ '% 'identified BY '123456'; // create user bob.
> Grant all privileges on *. * TO 'bob' @ 'localhost' identified by '123 ';
// Set bob to log on locally and assign all permissions to bob, because bob is the administrator!
> Grant all privileges on *. * TO 'bob' @ '% 'identified BY '123 ';
// The user address can be localhost, IP address, machine name, and domain name. You can also use '%' to connect from any address.
> Flush privileges; // refresh authorization
> Create database travel character set utf8 COLLATE utf8_general_ci; // CREATE a DATABASE travel and SET it to utf8 format.
> Quit

# Mysql-uroot-p travel <travel20120410. SQL // For convenience, I directly imported a copy of data. The root password is blank by default, so the database name is directly followed.

# Mysql-ubob-p123456 press ENTER

> Show databases; // view the database
> Select user, host, password from mysql. user; // bob log on to view all existing users
> \ S or SELECT CURRENT_USER (); // view the current user
> Use travel;
> Show tables;
> Show grants; // view your Permissions
> Show grants for dba @ localhost; // view dba Permissions
> Revoke all on *. * from dba @ localhost; // remove the dba permission
> Update user set password = password ("password") where user = 'root' // modify the root password
# Mysqladmin-uroot-p old password new password // modify root password
# Mysql-ubob-pbob-h192.168.19.182 travel // remotely log on to Mysql database 182

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.