Error 1061 mysql

Here are some simple steps that can help you fix your mysql error 1061 problem. Error 1061 (MYSQL Workbench) Multiplication of keys while creating an index     I don’t understand why I keep getting your 1061 error for duplicate keys in search engines when I have no duplicates. I’ve looked at other Stackoverflow ... Read more

PC running slow?

  • 1. Download ASR Pro from the website
  • 2. Install it on your computer
  • 3. Run the scan to find any malware or virus that might be lurking in your system
  • Improve the speed of your computer today by downloading this software — it will fix your PC problems.

    Here are some simple steps that can help you fix your mysql error 1061 problem. Error 1061 (MYSQL Workbench) Multiplication of keys while creating an index

    I don’t understand why I keep getting your 1061 error for duplicate keys in search engines when I have no duplicates. I’ve looked at other Stackoverflow articles on quite a few questions, most of them and got this problem when they had the same name for several different foreign keys. However, this does not apply to my whole case.

    In short, I created a spreadsheet and task related accounts.Each book.id has several tasks associated with that particular post.This is a many-to-many relationship, meaning that there are several books associated with a specific task. And having a specific task, the ability to associate with many books.

    So, between these many relationships, I have a table of x task books that can mediate. This table has its own primary key and two unusual keys. One is the workbook ID of the workbook tables and the username of the task table task. Hence, these are all foreign keys. In this way, I can link multiple tasks to multiple logs, such asEach is identified by its own pending ID in the booksxtasks table.

    Run SQL script on server ERROR: 1061: error in duplicate key name ‘FK Tasks_TaskID_idx’ SQL code: CREATE INDEX `FK Tasks_TaskID_idx` ON` mydb`.`BooksxTasks` (` Tasks_TaskID` ASC)

    PC running slow?

    ASR Pro is the ultimate solution for your PC repair needs! Not only does it swiftly and safely diagnose and repair various Windows issues, but it also increases system performance, optimizes memory, improves security and fine tunes your PC for maximum reliability. So why wait? Get started today!

      CREATE TABLE IF `mydb` does not exist. `BooksxTasks` (  `BooksxTasksID` INT UNSIGNED NOT NULL AUTO_INCREMENT,  `Books_BookID` INT UNSIGNED NOT NULL,  Tasks_TaskID TINYINT (2) NOT SIGNED NOT NULL,  PRIMARY KEY (`booksxtasksid`), RESTRICTION `FK Tasks_TaskID`    FOREIGN KEY (`Tasks_TaskID`)    REFERENCES `mydb`.`Tasks` (` TaskID`)    WITHOUT DELETE ACTION    WITHOUT UPDATE ACTION,  RESTRICTION `FK Books_BooksID`    FOREIGN KEY (`Books_BookID`)    REFERENCES `mydb`.`Books` (` BookID`)    WITHOUT DELETE ACTION    WITHOUT UPDATE ACTION)ENGINE = InnoDB;CREATE INDEX `FK Tasks_TaskID_idx` ON` mydb`.`BooksxTasks` (` Tasks_TaskID` ASC);CREATE INDEX `FK Books_BooksID_idx` mydb` in` BooksxTasks` (`Books_BookID` ASC); 

    I also saw that all names were given subject to all constraints in the dataset. There were no duplicate names. So where did this double key error come from?

    I got this error while creating foreign keys for a 2-column “association” table.

    Step ( ) After creating both parents with PK, I created a child table.
    Step (b) Then I tried to change it with two definitions of fk.

    error 1061 mysql

    Regardless of the order in which I shot in step (b), I still get multiple consecutive errors in the second step.
    Definition:
    ERROR 1061 (42000): Duplicate key name cm_article_contents

    Create cm_articles tables
    (
    non-zero bigint article_id,
    article_type_id bigint is not zero,
    varchar (512) null header,
    web_title varchar (128) null,
    zero bridge varchar (256),
    null varchar (256) notes,
    Description varchar (512) null,
    owner_id bigint null,
    The start_dt timestamp is behind zero current_timestamp,
    timestamp null end_dt,
    Primary key (article_id)
    );

    Create table cm_contents
    (
    content_id bigint as opposed to null,
    content_type_id bigint null,
    Blob with zero content,
    content_desc varchar (256) null,
    non-zero bigint display_seq,
    versioned symbol (1) non-zero expiration,
    Primary key (content_id)
    );

    Add FK 1 constraint:
    ================
    Change chair cm_article_contents
    Add constraint cm_art_cont_1
    The foreign key cm_article_contents (article_id) refers to cm_articles (article_id);

    Add FK 2 constraint:
    ================
    Modify the cm_article_contents table
    Add constraint cm_art_cont_2
    The foreign key cm_article_contents (content_id) refers to cm_contents (content_id);

    This Account Has Been Locked

    MySQL: “Duplicate key name” error occurs when creating craps table with two foreign keys

    error 1061 mysql

    Although MySQL is reporting an error on my website when creating a new table, which I cannot explain.

      CREATE TABLE products (    id INT NOT NULL,    PRIMARY KEY (id));CREATE TABLE Transfer Warehouse (    Season DATE TIME NOT ANNOTATION,    product1 INT NOT NULL,    product2 INT NOT NULL,    FOREIGN WAREHOUSE KEY TRAFFIC (product1) LINKS Products (id),    FOREIGN WAREHOUSE KEY MOVEMENT (product2) REFERENCES Products (id)); 

    Error ERROR 1061 (42000): Duplicate key name "WarehouseMovements" . If I remove all foreign key constraints I succeed, but I want to make sure product1 and product2 are indeed pointing somewhere.

      CREATE TABLE products (    id INT NOT NULL,    PRIMARY KEY (id));CREATE TABLE Transfer Warehouse (    precious time NON-ZERO DATETIME,    product1 INT NOT NULL,    product2 INT NOT NULL,    INOCOUNTRY KEY IX_WarehouseMovements_product1 (product1) LINKS to products (id),    FOREIGN KEY IX_WarehouseMovements_product2 (product2) LINKS Products (id)); 

    This is the index or FK name, not the table name. To create foreign keys for a table, see the documentation:

      [LIMITATION [character]] FOREIGN KEY[index_name] (index_col_name, ...)REFERENCES tbl_name (index_col_name, ...) 

    index_name specifies the identifier for the foreign key. If specified, this fact will be ignored ifthe index for the unknown key is explicitly defined. Otherwise, ifMySQL allows index for foreign key, application uses index for index_nameIndex name.

      CREATE TABLE products (    id INT NOT NULL,    PRIMARY KEY (id));CREATE TABLE Transfer Warehouse (    evening TIME TIME IS NOT UP-TO-DATE,    product1 INT NOT NULL,    product2 INT NOT NULL,    RESTRICTION fk_product_1 FOREIGN KEY (product1) LINKS to products (id),    RESTRICTION fk_product_2 FOREIGN KEY (product2) LINKS to products (id)); 
      ALTER TABLE `cca_orders`ADD LIMITATION `item_id`FOREIGN KEY (`item_id`)` joshi_textile_db`Links. `cca_items_master` (` id`)DELETEON limit RESTRICTION UPDATED  I; 

    Improve the speed of your computer today by downloading this software — it will fix your PC problems.

    So Beheben Sie Den MySQL-Fehler 1061
    Comment Restaurer L’erreur Mysql 1061
    Mysql 오류 1061을 수정하는 방법
    Come Correggere L’errore Mysql 1061
    Hoe Tijd Voor Het Oplossen Van Mysql Error 1061
    Como Corrigir O Erro 1061 Do Banco De Dados Mysql
    Hur Det Löser Mysql -fel 1061
    Как это поможет исправить ошибку Mysql 1061
    Cómo: Corregir El Error De Mysql 1061
    Jak Naprawić Błąd Usługi Mysql 1061

    Содержание

    1. How To Fix Mysql Error 1061
    2. PC running slow?
    3. PC running slow?
    4. This Account Has Been Locked
    5. ERROR 1061 (42000) at line 26: Duplicate key name ‘book_id’ #125
    6. Comments
    7. grafana use mysql 5.6 init start error Error 1061: Duplicate key name ‘UQE_user_login’ #14351
    8. Comments
    9. What Grafana version are you using?
    10. What datasource are you using?
    11. What OS are you running grafana on?
    12. What did you do?
    13. What was the expected result?
    14. What happened instead?
    15. If related to metric query / data viz:
    16. Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.
    17. mysql cannot drop index needed foreign key constraint и тут же Duplicate key name. Ошибки при удалении внешнего ключа
    18. Primary tabs
    19. Forums:
    20. Наблюдения
    21. Причина
    22. Error during installation: Syntax error or access violation: 1061 Duplicate key name ‘search’ #335
    23. Comments

    How To Fix Mysql Error 1061

    Table of Contents

    PC running slow?

    Here are some simple steps that can help you fix your mysql error 1061 problem. Error 1061 (MYSQL Workbench) Multiplication of keys while creating an index

    I don’t understand why I keep getting your 1061 error for duplicate keys in search engines when I have no duplicates. I’ve looked at other Stackoverflow articles on quite a few questions, most of them and got this problem when they had the same name for several different foreign keys. However, this does not apply to my whole case.

    In short, I created a spreadsheet and task related accounts.Each book.id has several tasks associated with that particular post.This is a many-to-many relationship, meaning that there are several books associated with a specific task. And having a specific task, the ability to associate with many books.

    So, between these many relationships, I have a table of x task books that can mediate. This table has its own primary key and two unusual keys. One is the workbook ID of the workbook tables and the username of the task table task. Hence, these are all foreign keys. In this way, I can link multiple tasks to multiple logs, such asEach is identified by its own pending ID in the booksxtasks table.

    Run SQL script on server ERROR: 1061: error in duplicate key name ‘FK Tasks_TaskID_idx’ SQL code: CREATE INDEX `FK Tasks_TaskID_idx` ON` mydb`.`BooksxTasks` (` Tasks_TaskID` ASC)

    PC running slow?

    ASR Pro is the ultimate solution for your PC repair needs! Not only does it swiftly and safely diagnose and repair various Windows issues, but it also increases system performance, optimizes memory, improves security and fine tunes your PC for maximum reliability. So why wait? Get started today!

    I also saw that all names were given subject to all constraints in the dataset. There were no duplicate names. So where did this double key error come from?

    I got this error while creating foreign keys for a 2-column “association” table.

    Step ( ) After creating both parents with PK, I created a child table.
    Step (b) Then I tried to change it with two definitions of fk.

    Regardless of the order in which I shot in step (b), I still get multiple consecutive errors in the second step.
    Definition:
    ERROR 1061 (42000): Duplicate key name cm_article_contents

    Create cm_articles tables
    (
    non-zero bigint article_id,
    article_type_id bigint is not zero,
    varchar (512) null header,
    web_title varchar (128) null,
    zero bridge varchar (256),
    null varchar (256) notes,
    Description varchar (512) null,
    owner_id bigint null,
    The start_dt timestamp is behind zero current_timestamp,
    timestamp null end_dt,
    Primary key (article_id)
    );

    Create table cm_contents
    (
    content_id bigint as opposed to null,
    content_type_id bigint null,
    Blob with zero content,
    content_desc varchar (256) null,
    non-zero bigint display_seq,
    versioned symbol (1) non-zero expiration,
    Primary key (content_id)
    );

    Add FK 1 constraint:
    ================
    Change chair cm_article_contents
    Add constraint cm_art_cont_1
    The foreign key cm_article_contents (article_id) refers to cm_articles (article_id);

    Add FK 2 constraint:
    ================
    Modify the cm_article_contents table
    Add constraint cm_art_cont_2
    The foreign key cm_article_contents (content_id) refers to cm_contents (content_id);

    This Account Has Been Locked

    MySQL: “Duplicate key name” error occurs when creating craps table with two foreign keys

    Although MySQL is reporting an error on my website when creating a new table, which I cannot explain.

    Error ERROR 1061 (42000): Duplicate key name «WarehouseMovements» . If I remove all foreign key constraints I succeed, but I want to make sure product1 and product2 are indeed pointing somewhere.

    This is the index or FK name, not the table name. To create foreign keys for a table, see the documentation:

    index_name specifies the identifier for the foreign key. If specified, this fact will be ignored ifthe index for the unknown key is explicitly defined. Otherwise, ifMySQL allows index for foreign key, application uses index for index_nameIndex name.

    Источник

    ERROR 1061 (42000) at line 26: Duplicate key name ‘book_id’ #125

    Currently attempting to install Scalar per the instructions in the INSTALL.txt file.

    • Using PHP 7.2 & MySQL 5.7
    • Using the system/application/config/scalar_store.sql file as directed.
    • Using latest release of Scalar

    This only creates one table called scalar_db_books and the remaining tables within the sql file are not created.

    Additionally as a result, the enduser cannot connect to the site due to the lack of missing tables and is greeted with this error:

    Any troubleshooting insight would be greatly appreciated. Thanks!

    The text was updated successfully, but these errors were encountered:

    I’ve also been able to replicate this issue using PHP 7.2 & MySQL 5.5.6.

    Sorry you’re experiencing these errors!

    Is there a chance your database is forcing InnoDB (which respects foreign key restrains)? scalar_store should be using MyISAM (which does). I’ve never accounted that kind of error on my end, unfortunately. Do things behave different if you create the DB via phpMyAdmin as opposed to on the command line?

    The last commit to scalar_store.sql was a pull request by @arthurian . Arthur, curious if you have any thoughts?

    Thanks for the reply @craigdietrich and the tip on MyISAM. As an aside, since MySQL version 5.5 release in 2010, InnoDB has been the default engine. I’ll test changing the default engine to MyISAM and see what happens. For the future, would it be an idea to document this somewhere (e.g. INSTALL.txt and this repo’s README.md) along with general system requirements & dependencies for end-users especially first time users like myself? One other tip, mycrypt is no longer in PHP 7.2. Endusers will have to compile it to use it. Articles like this https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/ & and / or https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ can be helpful for Scalar users attempting to install as well. Thanks

    Actually, as of Scalar v2.5.5, the mcrypt library is no longer needed. Do we say somewhere that it is?

    Well, scalar_store.sql includes ENGINE=MyISAM in each statement, so I’ve always assumed that does the trick. Maybe that’s changed — maybe there’s some sort of override at the DB level now that takes precedence?

    Let us know if any of the above works for you

    If you do and I’ve clearly missed it then my apologies; I’d love to see that documentation. I’ve yet to find anywhere what PHP dependencies are actually required. My builds so far have been a cobbled together understanding gleaned from Google, searches of various existing Scalar projects, git repos and Dockerfiles. I can appreciate the focus is on getting the project going and fixing bugs but perhaps a documentation sprint to streamline things would be warranted in the future. Thanks for confirming mcrypt , I’ll take it out! 🙂

    Sorry, I’m a little confused: all you need to do to install Scalar is download the most current Release:

    . then put it on a LAMP server. From there install the DB and add some values to a few config files (described in INSTALL.txt). There aren’t any dependencies,

    Now, if you don’t have a LAMP server set up or are using an alternative approach, like Docker, I’ll have to defer, we haven’t done those types of installs on our end so unfortunately can’t be of help.

    I do not disagree that simplicity is what you and your team are aiming for however «LAMP server» in this context and in your argument above is an assumption that isn’t explained. The steps that go into setting one up depending on the OS distro can mean many things to different users.

    • What I meant by dependencies for example would be the choice of PHP modules and libraries one is using to set up said LAMP server. Here is what I’m currently using, please note php7.2-gd which in turn has further software package dependencies.

    It appears that you also use mysqli , this would be something that folks would have to consider running sudo phpenmod mysqli as a step for another instance.

    Here is what I’m using for Apache modules e.g. sudo a2enmod rewrite deflate headers expires remoteip xml2enc cache_disk I do plan on using ssl once we get this working. 😉

    So by using those three slight examples above, by no means am I faulting choices of tools nor abilities; you’ve stated clearly some of the challenges in other tickets e.g. #91 . I’m merely trying to point out knowing what to use is key and just trying to say gently and without malice, perhaps spelling out more of the steps in a piece of documentation might foster and encourage even more Scalar usage within a wider community. Getting folks past the install level is usually the first hurdle and obstacle in my experience.

    However on a different note, no luck on changing the MySQL engine. The script still errors.

    I can see that on the MySQL server that MyISAM is default

    I can also see that the only table created is also MyISAM

    Alas I cannot get the script to go further than creating the one table.

    Источник

    grafana use mysql 5.6 init start error Error 1061: Duplicate key name ‘UQE_user_login’ #14351

    What Grafana version are you using?

    What datasource are you using?

    What OS are you running grafana on?

    What did you do?

    systemctl start grafana-server

    What was the expected result?

    What happened instead?

    Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.

    The text was updated successfully, but these errors were encountered:

    What Grafana version did you upgrade from? Seems like you didn’t have this unique index before and you have duplicate rows for the same username. Probably same username with different spelling/casing. Please check content of user table, find duplicates and fix by either merging them or remove so there’s only one row with a certain username.

    @marefr my grafana version is 5.4.0 with new install ,not upgrade from other. first i use default storage with sqllite, then i want to change the storage to mysql. so i install mysql5.6 ,do ‘systemctl restart grafana-server’ case there error. i try drop the table of grafana.user ,but still case that error , then i drop the database grafana and create database grafana . restart grafana-server ,but it not ok ,still error .

    @marefr i try to delete the index of user.UQE_user_login still error.

    Okay. Seems like you may have some issues with your mysql installation — how did you install that? Docker? Please do a select * from migration_log of your Grafana database and include content here.

    This happens when a migration succeeds but isn’t properly recorded in the migration_log table, eg because Grafana was shut down or the database connection dropped. On the next start, Grafana tries to execute the migration again (because it isn’t in migration_log ) but the index (in this case) or column already exists, so the query fails with Error 1061: Duplicate key name or Error 1060: Duplicate column name .

    The simplest way to recover is to manually mark the migration as successful, which you can do with the following SQL:

    Should return a result like:

    If the error is 1060 or 1061 then you can (relatively) safely mark it as a successful migration and Grafana will start successfully:

    To fix this properly, the migration code in Grafana could be updated to check for existence of the index or column in its Sql method and emit a no-op SQL statement if it already exists and matches the spec, so that the migration could be marked as successful.

    Источник

    mysql cannot drop index needed foreign key constraint и тут же Duplicate key name. Ошибки при удалении внешнего ключа

    Primary tabs

    Forums:

    Наблюдения

    • при добавлении внешнего ключа автоматически создаётся идекс
    • Внешний ключ удаляем
    • Индекс остаётся удалить его нельзя, так как он якобы используется уже удалённым внешним ключом:

    ERROR 1553 (HY000): Cannot drop index ‘. ‘: needed in a foreign key constraint

    ERROR 1061 (42000): Duplicate key name ‘. ‘

    Версия базы: 5.7.22

    Причина

    Всё же оказалось, что в моём случае индекс был действительно последним для другого внешнего ключа (а не того, что я удалил).
    То есть алгоритм приведший к ошибке был такой:

    1. я создал ещё один внешний ключ, точно на тот же столбец, на котором уже был другой внешний ключ — внешних ключей стало 2, а вот индекс переименовался (то есть оба стали использовать один иднекс)
    2. Потом я удалил вророй ключ
    3. остался только один индекс и его удалить уже не получается, так как хоть имя этого иднекса имя как второго уже удалённого внешнего ключа (mysql создаёт идекс для столбцов-внешних ключей), но он используется первым внешним ключом (т.к. оба внешних ключа были на одной таблице).

    Источник

    Error during installation: Syntax error or access violation: 1061 Duplicate key name ‘search’ #335

    • BookStack Version: v0.15.1 release
    • PHP Version: 5.6.11
    • MySQL Version: 5.6.25 (through XAMPP)
    Expected Behavior

    I was installing BookStack on my Windows 10 machine, following the instructions here for manual installation. I am using Apache and MySQL through XAMPP. I followed all of the instructions in the link, except for making sure that the PHP extensions were installed, but they do not seem to be the cause of this issue. The configuration in .env was the local environment with debug set to true. I was expecting to be able to start Apache and MySQL through XAMPP and then go to localhost:80 to BookStack’s web interface.

    I had tried installing BookStack once before, but it failed with the same error, so I tried it again and this was what I got.

    Actual Behavior

    When I ran php artisan migrate in step 8 of the installation instructions, the following errors came:

    I checked the output in my browser at localhost:80, and there were two errors:

    I found the file (BookStack/database/migrations/2015_08_31_175240_add_search_indexes.php) where the line SQL: ALTER TABLE pages ADD FULLTEXT search(name, text) was, which was mentioned in the error message, and it seems that these were the troublesome lines:

    The text was updated successfully, but these errors were encountered:

    Источник

    @g7morris

    Currently attempting to install Scalar per the instructions in the INSTALL.txt file.

    • Using PHP 7.2 & MySQL 5.7
    • Using the system/application/config/scalar_store.sql file as directed.
    • Using latest release of Scalar
    root@5cf8a1674e70:/# mysql -u scalar_user -p scalar_store < scalar_store.sql
    Enter password: 
    ERROR 1061 (42000) at line 26: Duplicate key name 'book_id'
    

    This only creates one table called scalar_db_books and the remaining tables within the sql file are not created.

    Additionally as a result, the enduser cannot connect to the site due to the lack of missing tables and is greeted with this error:

    Fatal error: Uncaught Error: Call to a member function num_rows() on boolean in /var/www/html/system/libraries/Session.php:233 Stack trace: #0 /var/www/html/system/libraries/Session.php(107): CI_Session->sess_read() #1 /var/www/html/system/core/Loader.php(1100): CI_Session->__construct() #2 /var/www/html/system/core/Loader.php(976): CI_Loader->_ci_init_class('session', '', NULL, NULL) #3 /var/www/html/system/core/Loader.php(217): CI_Loader->_ci_load_class('Session', NULL, NULL) #4 /var/www/html/system/application/core/MY_Controller.php(42): CI_Loader->library('session') #5 /var/www/html/system/application/controllers/system.php(33): MY_Controller->__construct() #6 /var/www/html/system/core/CodeIgniter.php(309): System->__construct() #7 /var/www/html/codeigniter.php(203): require_once('/var/www/html/s...') #8 {main} thrown in /var/www/html/system/libraries/Session.php on line 233
    

    Any troubleshooting insight would be greatly appreciated. Thanks!

    @g7morris

    I’ve also been able to replicate this issue using PHP 7.2 & MySQL 5.5.6.

    @craigdietrich

    Hi @g7morris

    Sorry you’re experiencing these errors!

    Is there a chance your database is forcing InnoDB (which respects foreign key restrains)? scalar_store should be using MyISAM (which does). I’ve never accounted that kind of error on my end, unfortunately. Do things behave different if you create the DB via phpMyAdmin as opposed to on the command line?

    The last commit to scalar_store.sql was a pull request by @arthurian … Arthur, curious if you have any thoughts?

    @g7morris

    Thanks for the reply @craigdietrich and the tip on MyISAM. As an aside, since MySQL version 5.5 release in 2010, InnoDB has been the default engine. I’ll test changing the default engine to MyISAM and see what happens. For the future, would it be an idea to document this somewhere (e.g. INSTALL.txt and this repo’s README.md) along with general system requirements & dependencies for end-users especially first time users like myself? One other tip, mycrypt is no longer in PHP 7.2. Endusers will have to compile it to use it. Articles like this https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/ & and / or https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ can be helpful for Scalar users attempting to install as well. Thanks

    @craigdietrich

    Actually, as of Scalar v2.5.5, the mcrypt library is no longer needed. Do we say somewhere that it is?

    Well, scalar_store.sql includes ENGINE=MyISAM in each statement, so I’ve always assumed that does the trick. Maybe that’s changed — maybe there’s some sort of override at the DB level now that takes precedence?

    Let us know if any of the above works for you

    @g7morris

    If you do and I’ve clearly missed it then my apologies; I’d love to see that documentation. I’ve yet to find anywhere what PHP dependencies are actually required. My builds so far have been a cobbled together understanding gleaned from Google, searches of various existing Scalar projects, git repos and Dockerfiles. I can appreciate the focus is on getting the project going and fixing bugs but perhaps a documentation sprint to streamline things would be warranted in the future. Thanks for confirming mcrypt, I’ll take it out! :)

    @craigdietrich

    Sorry, I’m a little confused: all you need to do to install Scalar is download the most current Release:

    https://github.com/anvc/scalar/releases

    … then put it on a LAMP server. From there install the DB and add some values to a few config files (described in INSTALL.txt). There aren’t any dependencies,

    Now, if you don’t have a LAMP server set up or are using an alternative approach, like Docker, I’ll have to defer, we haven’t done those types of installs on our end so unfortunately can’t be of help.

    @g7morris

    I do not disagree that simplicity is what you and your team are aiming for however «LAMP server» in this context and in your argument above is an assumption that isn’t explained. The steps that go into setting one up depending on the OS distro can mean many things to different users.

    • What I meant by dependencies for example would be the choice of PHP modules and libraries one is using to set up said LAMP server. Here is what I’m currently using, please note php7.2-gd which in turn has further software package dependencies.
    sudo apt-get install -y php7.2 apache2 python-mysqldb libxml2-dev libapache2-mod-php7.2 libcurl4-openssl-dev php7.2 php7.2-cli php7.2-json php7.2-common php7.2-readline php-pear php7.2-curl php7.2-mbstring php7.2-xmlrpc php7.2-dev php7.2-ldap php7.2-xml php7.2-mysql php7.2-soap php7.2-xsl php7.2-zip php7.2-bcmath php7.2-intl php-uploadprogress libicu-dev php7.2-gd libxslt1.1 libxslt1-dev libfreetype6-dev libjpeg-turbo8-dev libpng-dev
    • It appears that you also use mysqli , this would be something that folks would have to consider running sudo phpenmod mysqli as a step for another instance.

    • Here is what I’m using for Apache modules e.g. sudo a2enmod rewrite deflate headers expires remoteip xml2enc cache_disk I do plan on using ssl once we get this working. ;)

    So by using those three slight examples above, by no means am I faulting choices of tools nor abilities; you’ve stated clearly some of the challenges in other tickets e.g. #91 . I’m merely trying to point out knowing what to use is key and just trying to say gently and without malice, perhaps spelling out more of the steps in a piece of documentation might foster and encourage even more Scalar usage within a wider community. Getting folks past the install level is usually the first hurdle and obstacle in my experience.

    However on a different note, no luck on changing the MySQL engine. The script still errors.

    I can see that on the MySQL server that MyISAM is default

    mysql> show engines;
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | InnoDB             | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
    | MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
    | MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
    | BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
    | MyISAM             | DEFAULT | MyISAM storage engine                                          | NO           | NO   | NO         |
    | CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
    | ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
    | PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
    | FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    9 rows in set (0.00 sec)

    I can also see that the only table created is also MyISAM

    mysql> SELECT TABLE_NAME, ENGINE FROM   information_schema.TABLES WHERE  TABLE_SCHEMA = 'scalar_store';
    +-----------------+--------+
    | TABLE_NAME      | ENGINE |
    +-----------------+--------+
    | scalar_db_books | MyISAM |
    +-----------------+--------+
    1 row in set (0.00 sec)

    Alas I cannot get the script to go further than creating the one table.

    @craigdietrich

    Sorry to hear our documentation isn’t thorough enough for your needs. We’d be happy to accept a pull request if you sort things out and want to contribute to future users.

    Unfortunately, installing PHP, its modules, and debugging MySQL import errors is beyond what are little team can provide. Maybe someone from outside the Scalar team camp can jump in.

    @g7morris

    @craigdietrich No worries. I’d be glad to offer a pull request on that front for your review and for other users once I can get it working ;).

    I can fully understand your team’s challenges. I appreciate anyone looking into the issue when / if they can.

    @g7morris

    @craigdietrich I think I might have gotten it sorted after all and I’m just leaving this here for any further feedback if warranted or any others having challenges.

    Per your good suggestion above, I started using a MySQL GUI instead of the command line. I pulled apart the script and ran the CREATE TABLES commands one by one, noting errors and the like.

    Most ran but only two were hold outs and posted errors.

    The first holdout appeared to be MySQL 5.7 specific: ERROR 1067 (42000): Invalid default value for 'datetime' which apparently is a result of constraints outlined in detail here https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html

    CREATE TABLE IF NOT EXISTS `scalar_db_rel_replied` ( `parent_version_id` int(10) unsigned NOT NULL DEFAULT '0', `child_version_id` int(10) unsigned NOT NULL DEFAULT '0', `paragraph_num` int(5) unsigned NOT NULL DEFAULT '0', `datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, KEY `parent_child` (`parent_version_id`,`child_version_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    I wasn’t able to get it going from suggestions like https://stackoverflow.com/questions/9192027/invalid-default-value-for-create-date-timestamp-field however I was able to by using:

    SET SQL_MODE='ALLOW_INVALID_DATES'; which may not be ideal but allows me to proceed.


    The second error the originally reported ERROR 1061 (42000): Duplicate key name 'book_id' appears to come when I run this:

    CREATE TABLE IF NOT EXISTS `scalar_db_content` (
      `content_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `book_id` int(10) unsigned NOT NULL DEFAULT '0',
      `recent_version_id` int(10) unsigned NOT NULL DEFAULT '0',
      `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `type` enum('composite','media') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'composite',
      `is_live` tinyint(1) unsigned NOT NULL DEFAULT '1',
      `paywall` tinyint(1) unsigned NOT NULL DEFAULT '0',
      `thumbnail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `background` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `banner` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `custom_style` text COLLATE utf8_unicode_ci DEFAULT NULL,
      `custom_scripts` text COLLATE utf8_unicode_ci DEFAULT NULL,
      `color` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
      `audio` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `category` enum('commentary','review','term') COLLATE utf8_unicode_ci DEFAULT NULL,
      `user` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
      `created` datetime NOT NULL,
      PRIMARY KEY (`content_id`),
      UNIQUE (`book_id`, `slug`),
      KEY `book_id` (`book_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    When I remove the last lineKEYbook_id (book_id), the script completes, the tables are created and I am looking at a new Scalar site! I’ve been able to login, create books and content … so far. Neat stuff.

    @craigdietrich Can you think of any negative impact offhand from removing that line?

    What versions of MySQL do folks tend use typically? If 5.7 is too restrictive, how far back should I install to 5.5.x or 5.4?

    Thanks again for all your help and previous suggestions.

    @craigdietrich

    Hey thanks @g7morris for sticking with this!

    Re the first problem (datetime), I went ahead and updated SQL files to use CURRENT_TIMESTAMP as the DEFAULT, which I think will correct the problem:

    9b4e009
    14f635e

    Re the second (UNIQUE), I think we should wait to see what @arthurian says, since he committed that addition and it was needed for the S3 filesystem to work properly.

    @g7morris

    Thanks @craigdietrich for the fixes, I’ll test shortly. I also appreciate you reaching out to @arthurian for any further insight. Thanks in advance @arthurian for any tips, thoughts etc.

    @arthurian

    @craigdietrich @g7morris My apologies for not responding sooner regarding the second error. That’s definitely my fault, as I had introduced that particular UNIQUE constraint in PR #123.

    The intent was to add a database-level guarantee that all of the slugs in a book are unique. The more important UNIQUE constraint is the one on scalar_db_books, which guarantees the uniqueness of a book slug globally. That’s the one that we had to fix to make the S3 filesystem work properly. The additional UNIQUE constraint on scalar_db_content was not strictly necessary, but I think it’s still a good idea, because it formalizes the implicit constraints that already exist in the application.

    In any case, the issue with the CREATE TABLE statement is that there are two indexes being created on scalar_db_content: an index on book_id and a secondary unique index on the book_id and slug. It appears that since the UNIQUE constraint does not have an assigned name, it is defaulting to book_id (the first of the two columns), which also happens to be the name of the KEY constraint (e.g. the index on book_id). You can’t have duplicate index names, hence the error.

    One solution is to name the UNIQUE constraint within the CREATE TABLE statement:

    UNIQUE `book_id_slug_uq` (`book_id`, `slug`)

    So the complete table statement becomes:

    CREATE TABLE IF NOT EXISTS `scalar_db_content` (
      `content_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `book_id` int(10) unsigned NOT NULL DEFAULT '0',
      `recent_version_id` int(10) unsigned NOT NULL DEFAULT '0',
      `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `type` enum('composite','media') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'composite',
      `is_live` tinyint(1) unsigned NOT NULL DEFAULT '1',
      `paywall` tinyint(1) unsigned NOT NULL DEFAULT '0',
      `thumbnail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `background` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `banner` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `custom_style` text COLLATE utf8_unicode_ci DEFAULT NULL,
      `custom_scripts` text COLLATE utf8_unicode_ci DEFAULT NULL,
      `color` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
      `audio` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `category` enum('commentary','review','term') COLLATE utf8_unicode_ci DEFAULT NULL,
      `user` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
      `created` datetime NOT NULL,
      PRIMARY KEY (`content_id`),
      UNIQUE `book_id_slug_uq` (`book_id`, `slug`),
      KEY `book_id` (`book_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    I might also suggest giving the KEY index a name such as book_id_idx to further disambiguate the two index names. But that’s not necessary to resolve the problem at hand.

    @craigdietrich Do you want me to submit a PR with the fix, or do you want to take it?

    @craigdietrich

    Hiya @arthurian

    This seems fine to me. That «book_id_slug_uq» is just the identifier for the UNIQUEness, right? It doesn’t really show up anywhere?

    @arthurian

    @craigdietrich Yeah that’s just the identifier for the unique constraint — it won’t show up anywhere other than when you’re in the database looking at the constraints.

    Понравилась статья? Поделить с друзьями:
  • Error 1061 duplicate key name
  • Error 1060 42s21 duplicate column name
  • Error 106 это
  • Error 106 клапан clack
  • Error 106 invalid numeric format