• Hey Guest, we're evolving the future of TeaSpeak.
    You're invited to join the discussion here!

Pending Mysql connect error

M4T14SG4M3R

Well-known member
Hi, i want to know how i can fix the error for the mysql option, i'm trying to connect it to a mysql server version less than 5.7 and i get this:

[2019-08-04 11:40:55] [INFO] GEN | Upgrading database from version -1 to 10. This could take a moment!
[2019-08-04 11:40:58] [ERROR] GEN | SQL Error: Specified key was too long; max key length is 767 bytes
[2019-08-04 11:40:58] [CRITICAL] GEN | Could not initialize SQL!
[2019-08-04 11:40:58] [CRITICAL] GEN | Could not setup SQL table indexes! Command 'CREATE INDEX `idx_general_key` ON `general` (`key`);' returns sql: CREATE INDEX `idx_general_key` ON `general` (`key`); returned -> -1/Specified key was too long; max key length is 767 bytes
[2019-08-04 11:40:58] [INFO] GEN | Stopping application
[2019-08-04 11:40:58] [INFO] GEN | Application suspend successful!

I have a database with version higher than 5.7 but it uses cpanel, so the database name and users contains a "_", and i can't use the mysql:// url with a "_" inside of it because it throws and error on start
 

WolverinDEV

TeaSpeak Team
Staff member
Administrator
"Specified key was too long; max key length is 767 bytes" it seems like there is a mysql limit which prevents that stuff.
Ever goggled if its possible to increase this limit?
 

M4T14SG4M3R

Well-known member
I already tried searching on google and can't find a fix, i can only fix if i know how to use the mysql:// url with "_" inside of it
 

WolverinDEV

TeaSpeak Team
Staff member
Administrator
"%5F" thats interesting....
Seems like for some reason there is some URL escaping...

EDIT: Has you may typed "test%5Fts3"? Because the host is in general not URL escaped :D
 

M4T14SG4M3R

Well-known member
The url is this (**** means sensitive data)
mysql://****:3306/test_teamspeak?userName=test_ts3&password=****&connections=8
 

Leutech

Active member
Premium User
@M4T14SG4M3R in your case with the problem

Specified key was too long; max key length is 767 bytes
Add in your mysql config file after [mysqld] the following options:
Code:
[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
If you use mariadb the config is 50-server.cnf in /etc/mysql/mariadb.conf.d/
And in normal mysql the config is my.cnf in /etc/mysql
 

M4T14SG4M3R

Well-known member
@M4T14SG4M3R in your case with the problem



Add in your mysql config file after [mysqld] the following options:
Code:
[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
If you use mariadb the config is 50-server.cnf in /etc/mysql/mariadb.conf.d/
And in normal mysql the config is my.cnf in /etc/mysql
Didn't worked
1589870059492.png1589870071596.png
(I did the service mysqld restart and still didn't worked)
 

Leutech

Active member
Premium User
The fastest way is over phpmyadmin but if you prefer to do it over the command line than you can use google how to see and set the collation

---- Automatically Merged Double Post ----

The command to see the databse collation is the following.

USE databasename;
SELECT @@character_set_database, @@collation_database;

And than use this command
ALTER DATABASE <database_name> CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
Last edited:

M4T14SG4M3R

Well-known member
The fastest way is over phpmyadmin but if you prefer to do it over the command line than you can use google how to see and set the collation

---- Automatically Merged Double Post ----

The command to see the databse collation is the following.

USE databasename;
SELECT @@character_set_database, @@collation_database;

And than use this command
ALTER DATABASE <database_name> CHARACTER SET utf8 COLLATE utf8_unicode_ci;
1591151844138.png1591151941008.png1591151996714.png
 

BIOS

TeaSpeak Team
Staff member
TeaTeam
Premium User
in your password you cant use special characters like !"§$%& etc
 

WolverinDEV

TeaSpeak Team
Staff member
Administrator
Well I don't think that is is related to the password.
MySQL in general wants to have a fixed length column type.

My guess it that the column `values` in the general table should be created with something longer than the allowed maximum.
The maximum could be changed. Maybe google the error message.
 

Kevinos

Fanatic member
Premium User
Test add in my.cnf

[mysqld]
innodb_file_per_table=1
innodb_large_prefix=1
innodb_file_format=Barracuda

and restart mysql server