Skip to content

Instantly share code, notes, and snippets.

@austinjp
Created January 6, 2016 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinjp/70133db919796c34f8b2 to your computer and use it in GitHub Desktop.
Save austinjp/70133db919796c34f8b2 to your computer and use it in GitHub Desktop.
Errors when running Wordpress for the first time

WordPress database error: [Invalid default value for 'user_registered'] CREATE TABLE wp_users ( ID bigint(20) unsigned NOT NULL auto_increment, user_login varchar(60) NOT NULL default '', user_pass varchar(64) NOT NULL default '', user_nicename varchar(50) NOT NULL default '', user_email varchar(100) NOT NULL default '', user_url varchar(100) NOT NULL default '', user_registered datetime NOT NULL default '0000-00-00 00:00:00', user_activation_key varchar(60) NOT NULL default '', user_status int(11) NOT NULL default '0', display_name varchar(250) NOT NULL default '', PRIMARY KEY (ID), KEY user_login_key (user_login), KEY user_nicename (user_nicename) )

WordPress database error: [Invalid default value for 'comment_date'] CREATE TABLE wp_comments ( comment_ID bigint(20) unsigned NOT NULL auto_increment, comment_post_ID bigint(20) unsigned NOT NULL default '0', comment_author tinytext NOT NULL, comment_author_email varchar(100) NOT NULL default '', comment_author_url varchar(200) NOT NULL default '', comment_author_IP varchar(100) NOT NULL default '', comment_date datetime NOT NULL default '0000-00-00 00:00:00', comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', comment_content text NOT NULL, comment_karma int(11) NOT NULL default '0', comment_approved varchar(20) NOT NULL default '1', comment_agent varchar(255) NOT NULL default '', comment_type varchar(20) NOT NULL default '', comment_parent bigint(20) unsigned NOT NULL default '0', user_id bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (comment_ID), KEY comment_post_ID (comment_post_ID), KEY comment_approved_date_gmt (comment_approved,comment_date_gmt), KEY comment_date_gmt (comment_date_gmt), KEY comment_parent (comment_parent) )

WordPress database error: [Invalid default value for 'link_updated'] CREATE TABLE wp_links ( link_id bigint(20) unsigned NOT NULL auto_increment, link_url varchar(255) NOT NULL default '', link_name varchar(255) NOT NULL default '', link_image varchar(255) NOT NULL default '', link_target varchar(25) NOT NULL default '', link_description varchar(255) NOT NULL default '', link_visible varchar(20) NOT NULL default 'Y', link_owner bigint(20) unsigned NOT NULL default '1', link_rating int(11) NOT NULL default '0', link_updated datetime NOT NULL default '0000-00-00 00:00:00', link_rel varchar(255) NOT NULL default '', link_notes mediumtext NOT NULL, link_rss varchar(255) NOT NULL default '', PRIMARY KEY (link_id), KEY link_visible (link_visible) )

WordPress database error: [Invalid default value for 'post_date'] CREATE TABLE wp_posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) unsigned NOT NULL default '0', post_date datetime NOT NULL default '0000-00-00 00:00:00', post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content longtext NOT NULL, post_title text NOT NULL, post_excerpt text NOT NULL, post_status varchar(20) NOT NULL default 'publish', comment_status varchar(20) NOT NULL default 'open', ping_status varchar(20) NOT NULL default 'open', post_password varchar(20) NOT NULL default '', post_name varchar(200) NOT NULL default '', to_ping text NOT NULL, pinged text NOT NULL, post_modified datetime NOT NULL default '0000-00-00 00:00:00', post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content_filtered longtext NOT NULL, post_parent bigint(20) unsigned NOT NULL default '0', guid varchar(255) NOT NULL default '', menu_order int(11) NOT NULL default '0', post_type varchar(20) NOT NULL default 'post', post_mime_type varchar(100) NOT NULL default '', comment_count bigint(20) NOT NULL default '0', PRIMARY KEY (ID), KEY post_name (post_name), KEY type_status_date (post_type,post_status,post_date,ID), KEY post_parent (post_parent), KEY post_author (post_author) )

WordPress database error: [Table 'wordpress.wp_users' doesn't exist] SELECT * FROM wp_users WHERE user_login = 'admin'

WordPress database error: [Table 'wordpress.wp_users' doesn't exist] SELECT * FROM wp_users WHERE user_login = 'admin'

WordPress database error: [Table 'wordpress.wp_users' doesn't exist] SELECT * FROM wp_users WHERE user_email = 'email'

WordPress database error: [Table 'wordpress.wp_users' doesn't exist] SELECT ID FROM wp_users WHERE user_nicename = 'admin' AND user_login != 'admin' LIMIT 1

WordPress database error: [Table 'wordpress.wp_users' doesn't exist] INSERT INTO wp_users (user_pass,user_email,user_url,user_nicename,display_name,user_registered,user_login) VALUES ('blah','email','','admin','admin','2016-01-06 11:21:05','admin')

WordPress database error: [Table 'wordpress.wp_posts' doesn't exist] INSERT INTO wp_posts (post_author,post_date,post_date_gmt,post_content,post_excerpt,post_title,post_name,post_modified,post_modified_gmt,guid,comment_count,to_ping,pinged,post_content_filtered) VALUES (0,'2016-01-06 11:21:05','2016-01-06 11:21:05','Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!','','Hello world!','hello-world','2016-01-06 11:21:05','2016-01-06 11:21:05','http://domain.com/?p=1',1,'','','')

WordPress database error: [Table 'wordpress.wp_comments' doesn't exist] INSERT INTO wp_comments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_date,comment_date_gmt,comment_content) VALUES (1,'Mr WordPress','','http://wordpress.org/','2016-01-06 11:21:05','2016-01-06 11:21:05','Hi, this is a comment.\nTo delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.')

WordPress database error: [Table 'wordpress.wp_posts' doesn't exist] INSERT INTO wp_posts (post_author,post_date,post_date_gmt,post_content,post_excerpt,post_title,post_name,post_modified,post_modified_gmt,guid,post_type,to_ping,pinged,post_content_filtered) VALUES (0,'2016-01-06 11:21:05','2016-01-06 11:21:05','This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:\n\n

Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)
\n\n...or something like this:\n\n
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
\n\nAs a new WordPress user, you should go to <a href="http://domain.com/wp-admin/\">your dashboard to delete this page and create new pages for your content. Have fun!','','Sample Page','sample-page','2016-01-06 11:21:05','2016-01-06 11:21:05','http://domain.com/?page_id=2','page','','','')

Success!

WordPress has been installed. Were you expecting more steps? Sorry to disappoint.

Username admin

Password Your chosen password.

@chrisdobler
Copy link

how did you resolve it?

@aleksanderjedynak
Copy link

localization---> C:\wamp64\bin\mysql\mysql5.7.19\my.ini
I changed this value
sql-mode="STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"
to such
sql-mode="NO_ENGINE_SUBSTITUTION"

@josh934
Copy link

josh934 commented Nov 19, 2018

still not working, what can i do

@josh934
Copy link

josh934 commented Nov 19, 2018

i am unable to login, i guess it's because of the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment