Jump to content

Pma Sql Import - #1709 - Index Column Size Too Large. The Maximum Column Size Is 767 Bytes.


sagnik

Recommended Posts

Please increase the Maximum column size of Indexes. i'm having problems on importing database in pma.

 

And as well as if you can increase the 'max_user_connection' that will be great help as I'm also getting this error frequently.

Link to comment
Share on other sites

When I hit that same limit I found a creative way to create a hash of the index column instead of the index column itself. It works much better than reducing the server performance by changing default settings. Check out something like http://mechanics.flite.com/blog/2015/06/09/hash-based-workarounds-for-mysql-unique-constraint-limitations/

 

As far as the max_user_connections, are you using persistent connections?

Link to comment
Share on other sites

Persistent connections https://dev.mysql.com/doc/apis-php/en/apis-php-mysqlnd.persist.html are mysql connections that you don't close. The advantage is that you don't have the overhead of creating and destroying connections. The downside is you use up one of your limited mysql connections and others who share your server suffer from degraded performance due to you hogging resources. As such we highly recommend closing your mysql connections.

Link to comment
Share on other sites

But I need at least 2 connections open until the script reaches it's end. And in addition, if needed I need to open another database in the members section.

Link to comment
Share on other sites

Do something like this

$conn = new mysqli("localhost", "user", "password123", "db");

$sql = "select things from stuff where id = '1'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();

$thread = $conn->thread_id;
$conn->kill($thread);
$conn->close();
Open then execute the query then close it immediately. No other code in between. Obviously don't do things like execute mysql queries inside loops, etc. Just write good code basically.
Link to comment
Share on other sites

But sir, I've 2 classes included in common in all pages, one is "WNInternal.php" (This takes care of the things related to Internal functions/features. For example "redirect users based on 'refid'", "get page url from database for mobile/desktop pages") and another is "Whatsnew.php" (It takes care of all the things related to Products/Categories). So how can I close the MySQL connection in between the script. But I've tried to close the connection using my own database function "db_close()" in "__destroy" function but it doesn't work, in fact, it triggers an E_WARNING level error saying that "mysqli_thread_id() - expects parameter 1 to be MySQLi resource", "mysqli_close() - expects parameter 1 to be MySQLi resource", "mysqli_kill() - expects parameter 1 to be MySQLi resource". I hope you can solve the problem. Sir you have root access, so you can check my custom database functions in "/home/sgn/public_html/wn/config/SGSSPL.php". If it needs any changes you can tell me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...