1

I am trying to import a sql file into a database hosted by my web host via its MYSQL administration program mysqladmin. Mysqladmin has an Import button that from what I can tell just runs some sql code. When I go through the steps, however, it give me the errors below. (I tried getting help from customer support but they don't support this.)

Here is what appears in pink in the error box:

Error
SQL query:

 CREATE TABLE IF NOT EXISTS `bookquotes` (
`index` VARCHAR(MAX) NULL,
`index_id` INT NULL,
`type` VARCHAR(MAX) NULL,
`line_id` INT NULL,
`book_name` VARCHAR(MAX) NULL,
`speech_number` INT NULL,
`line_number` VARCHAR(MAX) NULL,
`speaker` VARCHAR(MAX) NULL,
`text_entry` VARCHAR(MAX) NULL
)
MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX) NULL,
`index_id` INT NULL,
`type` VARCHAR(MAX) NULL,
`line_id` INT NULL,
`p' at line 2

Would appreciate any suggestions in what is wrong with the above SQL (I could run sql to add the table myself in PHP if I can get the right syntax) or otherwise how to import a sql file into a remote database.

Thanks for any suggestions.

6
  • 4
    There is no varchar(max) in mysql where/what dbserver did the .sql file come from?? Commented Mar 23, 2021 at 12:43
  • The sql file I am trying to add to the remote database was generated by app.konbert.com from a JSON file. Commented Mar 23, 2021 at 12:46
  • I get nothing (literally) from the posted link- are sure this app is for mysql and not sqlserver - in any case if you want to import to mysql you are going to have to transform the .sql file before import. Commented Mar 23, 2021 at 12:49
  • Yes, I looked in the sql file and sure enough it has the Max stuff. I'm changing it to text as suggested by Yoleth Commented Mar 23, 2021 at 12:52
  • 1
    You probably needed to use konbert.com/convert/json/to/mysql instead Commented Mar 23, 2021 at 12:57

1 Answer 1

2

You cannot use MAX in mysql, see the limitation documented here: https://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html

If you need very large text column use TEXT or instead use varchar with reasonable limit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.