I am trying to install the latest version of WordPress(4.6.1) in a local dev project environment. I just got a new iMac and I am in the process of moving my local instances of my projects to the new machine.
I am using Sequel Pro (v 1.1.2) to manage my databases & MAMP (3.4) to run my local server.
The connection to the database works as intended and I get to step 2 of the installation process however after putting in the following and clicking install there are errors and no tables are created in my database.
Site Title,
Username,
Password,
email,
Any help would be greatly appreciated. I am sure its something dumb. Just need another set of eyes. Thanks!
WordPress database install error:
WordPress database error: [Unknown character set: 'utf']
CREATE TABLE wp_users (
ID bigint(20) unsigned NOT NULL auto_increment,
user_login varchar(60) NOT NULL default '',
user_pass varchar(255) 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(255) 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),
KEY user_email (user_email) )
DEFAULT CHARACTER SET utf-8
WordPress database error: [Unknown character set: 'utf']
CREATE TABLE wp_usermeta (
umeta_id bigint(20) unsigned NOT NULL auto_increment,
user_id bigint(20) unsigned NOT NULL default '0',
meta_key varchar(255) default NULL,
meta_value longtext,
PRIMARY KEY (umeta_id),
KEY user_id (user_id),
KEY meta_key (meta_key(191)) )
DEFAULT CHARACTER SET utf-8
WordPress database error: [Unknown character set: 'utf']
CREATE TABLE wp_termmeta (
meta_id bigint(20) unsigned NOT NULL auto_increment,
term_id bigint(20) unsigned NOT NULL default '0',
meta_key varchar(255) default NULL,
meta_value longtext,
PRIMARY KEY (meta_id),
KEY term_id (term_id),
KEY meta_key (meta_key(191)) )
DEFAULT CHARACTER SET utf-8
wp-config.php file
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf-8');
The database itself is set at:
Database Encoding: UTF-8 Unicode (utf8)
Database Collation: utf8_general_ci
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
WordPress Codex
If you want to use the DDL format you've got than this will work.
DEFAULT CHARACTER SET utf8
Related
Continuation from this question:
PDO query updating a datetime column not in query
A column in my table called lastLoginDate was being automatically updated even though my prepared statement did not include said column.
Apparently, when I created the new column, a trigger was set.
Upon using the command SHOW CREATE TABLE table_name, I returned the following results:
CREATE TABLE `users_edi` (
`username` varchar(30) NOT NULL DEFAULT '',
`fullname` varchar(50) DEFAULT NULL,
`userlevel` tinyint(1) unsigned NOT NULL,
`ipaddress` varchar(30) DEFAULT NULL,
`email` varchar(150) DEFAULT NULL,
`entrydate` datetime DEFAULT NULL,
`division` varchar(35) DEFAULT NULL,
`password` varchar(32) DEFAULT NULL,
`userid` varchar(32) DEFAULT NULL,
`timestamp` int(11) unsigned NOT NULL,
`job_title` varchar(30) DEFAULT NULL,
`dept` varchar(50) DEFAULT NULL,
`phone` varchar(11) DEFAULT NULL,
`lastLoginDate` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, // <-- here
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
The table is years old. I just created the column and somehow, a trigger was set to it (I guess).
Regardless, I tried to remove it using the following command:
ALTER TABLE `users_edi`
`lastLoginDate` datetime DEFAULT NULL
But I only get the following error:
[Err] 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 '`lastLoginDate` datetime DEFAULT NULL' at line 4
How do I remove this trigger using the ALTER TABLE command or any other command?
ALTER TABLE users_edi MODIFY COLUMN lastLoginDate DATETIME DEFAULT NULL;
You might like to read this page on ALTER TABLE: https://dev.mysql.com/doc/refman/8.0/en/alter-table.html
While importing a Database file in myPHP Admin I'm getting the following error:
CREATE TABLE IF NOT EXISTS wpcp_2_aiowps_events ( id bigint(20) NOT NULL AUTO_INCREMENT, event_type varchar(150) NOT NULL DEFAULT '', username varchar(150) DEFAULT NULL, user_id bigint(20) DEFAULT NULL, event_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', ip_or_host varchar(100) DEFAULT NULL, referer_info varchar(255) DEFAULT NULL, url varchar(255) DEFAULT NULL, country_code varchar(50) DEFAULT NULL, event_data longtext, PRIMARY KEY (id) ) TYPE=MyISAM AUTO_INCREMENT=1 MySQL said: Documentation #1064 - 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=MyISAM AUTO_INCREMENT=1' at line 13
How can I solve this and import the data successfully without any errors
Note
The older TYPE option was synonymous with ENGINE. TYPE was deprecated in MySQL 4.0 and removed in MySQL 5.5. When upgrading to MySQL 5.5 or later, you must convert existing applications that rely on TYPE to use ENGINE instead.
So you should use
CREATE TABLE IF NOT EXISTS wpcp_2_aiowps_events ( id bigint(20) NOT NULL AUTO_INCREMENT, event_type varchar(150) NOT NULL DEFAULT '', username varchar(150) DEFAULT NULL, user_id bigint(20) DEFAULT NULL, event_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', ip_or_host varchar(100) DEFAULT NULL, referer_info varchar(255) DEFAULT NULL, url varchar(255) DEFAULT NULL, country_code varchar(50) DEFAULT NULL, event_data longtext, PRIMARY KEY (id) )ENGINE = MyISAM ;
I have the following SQL query
CREATE TABLE IF NOT EXISTS `Log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(11) unsigned NOT NULL,
`request_xml` BLOB NOT NULL,
`response_xml` LONGBLOB NOT NULL,
`timestamp_process_end` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`timestamp_response` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
could someone see any mistakes? Because it gives me a SQL Error when I run the code on server. But on localhost works without any problems (or phpmyadmin)
And btw this works on the server:
CREATE TABLE IF NOT EXISTS `lang` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`language` varchar(2) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
PRIMARY KEY (`id`)
);
that is written in the same style. Any remarks?
LE: Mysql Ver 14.14 Distrib 5.1.73
In the end, the problem was that on the remote server I couldn't have two DEFAULT CURRENT_TIMESTAMP, as stated here mysql link, but this is wired that on the localhost worked.
I am trying to install word press local on xampp and it works fine and the Apache and MySQL work fine on it , i create also new database using PHP myadmin and add new user with user name and password and i download word press file and put inside htdocs inside Xampp folders but when i try to install word press its give me this strange error
(
WordPress database error: [InnoDB is in read only mode.] 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) ) DEFAULT CHARACTER
SET utf8mb4 COLLATE utf8mb4_unicode_ci)
i tried to create even a new database, change password and make sure password right and all this but still same issue can I change the database to not read only from phpmyadmin?
you can change the read only mode from PhpMyAdmin section, when you open Php My admin you will see the tabs database SQL Status User
Go to Users and select your user and then you can change the user privileges by editing user privileges select all privileges and save then you can have all access and read only mode will be changed.
When using the query
select distinct(column_name) as column_name, data_type from information_schema.columns
where table_name='reg_add_ons' order by ordinal_position
I get an extra column on my dev server. On my local server everything works fine. This is the only table this happens on. I have tried dropping the table and adding it again with this statement
delimiter $$
CREATE TABLE `reg_add_ons` (
`add_on_id` int(10) NOT NULL AUTO_INCREMENT,
`eventcode` varchar(20) DEFAULT NULL,
`add_on_desc` varchar(250) DEFAULT NULL,
`add_on_price` decimal(10,2) DEFAULT NULL,
`add_on_detail` text,
`add_on_label` varchar(100) DEFAULT NULL,
`add_on_choices` varchar(200) DEFAULT NULL,
`image_name` varchar(100) DEFAULT NULL,
`internal_only` varchar(2) DEFAULT NULL,
`assign_code` text,
`reg_status` varchar(50) DEFAULT 'Active',
PRIMARY KEY (`add_on_id`)
) ENGINE=MyISAM AUTO_INCREMENT=89 DEFAULT CHARSET=latin1$$
I have a bit of the flu so this is not making sense to me right now.
Dev box is a Windows 7 machine running MySQL 5.6.10
Localhost is Windows 7 running MySQL 5.5.24
Production server is Linux MySQL 5.0.45
It is only this one table on this one machine (Dev) having problems. what is the field require_validation? Where does it come from?
Any insight is appreciated