Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB install fails #60

Open
petamem opened this issue Dec 10, 2015 · 5 comments
Open

DB install fails #60

petamem opened this issue Dec 10, 2015 · 5 comments

Comments

@petamem
Copy link

petamem commented Dec 10, 2015

After some serious hassle of installing GD (for Auth::Captcha).

No luck with DB init:

www PearlBee # /etc/init.d/mysql start
 * Checking mysqld configuration for mysql ...     [ ok ]
 * Starting mysql ...                              [ ok ]

www PearlBee # mysql -u root -p < db_patches/create_tables.sql
Enter password: 
ERROR 1136 (21S01) at line 121: Column count doesn't match value count at row 1

ok, let's try the other magic line:

www PearlBee # mysql -u root -p < db_patches/set_up_new_db.sql
Enter password: 
ERROR 1046 (3D000) at line 22: No database selected

No PearlBee here running yet...

@nlannuzel
Copy link

open db_patches/create_tables.sql
remove ",0" at the end of the last line:
INSERT INTO settings VALUES ('Europe/Bucharest',1,'','/','PearlBee',1);

This worked for me

@flingtoad
Copy link

The problem seems to be that the settings table is created with 6 columns:

CREATE TABLE IF NOT EXISTS `settings` (
  `timezone` varchar(255) NOT NULL,
  `social_media` tinyint(1) NOT NULL DEFAULT '1',
  `theme_folder` varchar(255) NOT NULL,
  `blog_name` varchar(255) NOT NULL,
  `multiuser` tinyint(1) NOT NULL DEFAULT '0',
  `id` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Settings table.';

The INSERT statement then tries to pass 7 values.

Removing the last value from the INSERT appears to work because you are now passing the right number of values. However, removing the trailing 0 value screws up the alignment of VALUE to COLUMN. Presumably, 'PearlBee' belongs in the 'blog_name' column. I think the incorrect item in the list of values is probably the third value ('') or the fourth value ('/'), depending on what we want to set as out 'theme_folder'. My guess is that '/' is the correct value for 'theme_folder'.

@huache
Copy link

huache commented Apr 15, 2016

In commit ac6032a
blog_path field in settings table was removed, but the committer forgot to change the last insert statement in db_patches/create_tables.sql.

@petamem
Copy link
Author

petamem commented Jul 3, 2016

Revisiting PearlBee...

  • the name of the SQL file in the docs does not match the filename actually being there. (create_tables.sql vs. create_tables_mySQL.sql), but ok:
# mysql -u root -p < db_patches/create_tables_mySQL.sql 
Enter password: 
ERROR 1064 (42000) at line 8: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TYPE role_type as enum('author','admin')' at line 1

oh come on...

http://stackoverflow.com/questions/1462497/creating-enum-variable-type-in-mysql
"No. MySQL does not support CREATE DOMAIN or CREATE TYPE as, for example, PostgreSQL does."

I also see no "ENUM" in the syntax definition of
https://mariadb.com/kb/en/sql-99/create-type-statement/

@huache
Copy link

huache commented Jul 9, 2016

@petamem Sorry, I am not very sure what exactly you wan to express.
It seems that someone changed the file db_patches/create_tables.sql to db_patches/create_tables_mySQL.sql, and change the sql statement. So, you are actually in front of a totally different problem now. Of course, the solution other people posted in this issue will be not worked. You need to find another solution.
However, if you just want to try PearlBee, checkout the commit ac6032a and modify the file like I said, It will be worked. I have tried it by myself. Good luck !

andrewalker pushed a commit to andrewalker/PearlBee that referenced this issue Nov 18, 2017
BLOGSPERL-221 still remains json isue change
andrewalker pushed a commit to andrewalker/PearlBee that referenced this issue Nov 18, 2017
Reverting BLOGSPERL-221

This reverts commit 6036118, reversing
changes made to 988dfdf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants