A solution to the problem that prompts specified key was too long max key ' length is 1000 bytes when Mysql is built _mysql

Source: Internet
Author: User
Tags dba create database
The index field length is too long,
1. Modify the length of the field
2. Modify the MySQL default storage engine
Join Default-storage-engine=innodb under [mysqld] of/ETC/MYSQL/MY.CNF
But it's clear in the building that you need to use the InnoDB engine.
SQL code
Copy Code code as follows:

CREATE TABLE ' ACS ' (
...
) Engine=innodb DEFAULT Charset=utf8;

Check the current engine
Copy Code code as follows:

Mysql> show engines;

Sure enough, no innodb.
To see if dynamic loading is supported, it is important to have_dynamic_loading this line, if yes, then continue
Copy Code code as follows:

Mysql>show variables like "have_%";

Installing Plug-ins
Copy Code code as follows:

mysql> INSTALL PLUGIN INNODB soname ' ha_innodb.so ';
Mysql> show engines;

MySQL database First contact with MySQL, and Oracle is still different Oh, the following is a brief introduction to the Linux MySQL build the library process.
#mysql

>create USER ' bob ' @ '% ' identified by ' 123456 '; Create user Bob.
>grant all privileges in *.* to ' bob ' @ ' localhost ' identified by ' 123456 ';
Set Bob to log on locally and assign all permissions to Bob, because Bob is the admin Oh!
>grant all privileges in *.* to ' bob ' @ '% ' identified by ' 123456 ';
The user's address can be localhost, or it can be an IP address, machine name, domain name. You can also use '% ' to indicate a connection from any address.
>flush privileges; Refresh Authorization
>create DATABASE Travel CHARACTER SET UTF8 COLLATE utf8_general_ci; Create the database travel and set it to the UTF8 format.
>quit

#mysql-uroot-p Travel < TRAVEL20120410.SQL//For convenience, I directly import a copy of the data, the root password defaults to NULL, so the following directly with the database name.

#mysql-ubob-p123456 Carriage return

>show DATABASES; View Database
>select User,host,password from Mysql.user; Bob logs in to see all the users that already exist
>\s or SELECT current_user (); View Current User
>use Travel;
>show tables;
>show grants; To view your permissions
>show grants for Dba@localhost; To view DBA permissions
>revoke all in *.* from Dba@localhost; To remove DBA permissions
>update User Set Password=password ("password") where user= ' root '//modify root password
#mysqladmin-uroot-p old password Password new password//modify root password
#mysql-ubob-pbob-h192.168.19.182 Travel//telnet to 182 this MySQL database

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.