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.
Related
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
I've been tasked with adding in a link/menu dashboard for my work. It needs to have user permissions to view/not view each link record on a per user basis.
Most time this is done with user groups, I need to do it per-user for per-link.
I have started by using a middle database table to join users and links as well as hold the user permission if they are allowed to view each link. I will show the Database design below.
What I need help with is build a table/grid to mass set permissions for each user on each menu link.
I would like to do it similar to this image below...
View full size image
So I need to pull in users from the database and the links from the database as well as the permission records.
Build a grid with users in the vertical column and links in the horizontal.
The permissions setting will then fill in the grid spaces and I think it would be best to have a simple Form Selection field for a yes/no value.
Admin can change permissions for each user and submit the form which will need to then update every Permission record!
Here is what my 3 demo database tables look like...
Links table
CREATE TABLE IF NOT EXISTS `links` (
`id` int(11) NOT NULL,
`parent` int(11) NOT NULL DEFAULT '0',
`sort` int(11) NOT NULL DEFAULT '0',
`text` char(32) COLLATE utf8_bin NOT NULL,
`link` text COLLATE utf8_bin NOT NULL,
`permission` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
User table
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'user',
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
**Permission table: user_link_permissions **
CREATE TABLE IF NOT EXISTS `user_link_permissions` (
`id` int(100) NOT NULL,
`user_id` int(30) NOT NULL,
`link_id` int(30) NOT NULL,
`permission` int(2) NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=latin1;
Where I need some help...
I am not sure how to best generate the Grid of Users, Links, and Permissions.
As well as how submitting all that data could be processed in the backend to save all settings.
I will post more progress as it comes but right now I could use some direction please?
I realize i'll need to query and get all users as well as all links and then all user_link_permissions but I am at a loss as to how to create this grid and make it all correspond with the correct values, etc.
UPDATE:
I just found this link which seems to do something similar which looks like a good reference. It even saves the grid value with AJAX which should simplify things and load I believe. http://runastartup.com/how-to-update-a-mysql-field-in-a-multi-table-matrix/
I have a project coming up for doing Admin functions so my question is this. I will try and be clear as possible.
I will have one SUPER-USER who updates all information for other regular-users/people(being our clients).
The clients/regular-users when they log in will only see their info and download files uploaded by SUPER-USER and not see for regular-users.
So if you are Client:#01 you will see the dashboard (welcome page) and your info. Can anyone suggest possible database designs for this.
How to use left/right sql-joins between the user and files table?
UPDATE
I have a users table as well as a company table that the user belongs to. So essentially I want something like this::
$sql = select everything in the users table where the username and pass = to the given form, then left or right join that username to the company that he belong to.
Then they will see their information. if logged in successfully. Because user #01 belongs to company #03 /#01 etc...
USER TABLE looks so
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(50) NOT NULL,
'lname` varchar(100) NOT NULL,
`username` varchar(50) ,
`password` varchar(100) ,
`company` varchar(50) // the company name that ther user belongs to
PRIMARY KEY (`id`)
COMPANY table
'id' int(11) not null auto_increment,
'user_id' int(11) //This is to tie the users to this table
'description' varchar(text),
'filename' varchar(25) not null,
'mimetype' varchar (25) not null
PRIMARY KEY ('id')
Well, it depends on how simple or complex you want to go. with something like this I usually will keep it relatively simple and have a main user database (for all users) example:
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(255) NOT NULL AUTO_INCREMENT,
`user_name` varchar(50) NOT NULL,
`user_pass` varchar(100) NOT NULL,
`user_permissions` tinyint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '1',
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MYISAM;
Then I would have possible a second table of permissions depending on how many permissions I was going to have. If all you are going to have is users and super users then you could probably just assign users a value of 0 and then super user a value of 1.
Then in your PHP script it would treat the users different based on their "user_permissions" value.
Now if you are intending to have lots of different levels of permissions then I would definitely create at least one more table to define permissions example:
CREATE TABLE IF NOT EXISTS `permission` (
`permission_id` int(255) NOT NULL AUTO_INCREMENT,
`permission_name` varchar(100) NOT NULL,
`permission_value` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MYISAM;
Then in the permissions table you could assign all sorts of different permissions... read, write, publish, admin, regular user, super user etc.
This is just a very simple starting point. hope that helps.
PHP version: 5.2.17
CakePHP version: 1.3.11
MySQL version: 5.5.9
I'm working on a very simple internal message board website for a client. Since it's for internal use only, the client requested that rather than having usernames and passwords, there is just a password. No usernames. There is one password for the administrator and another password for everybody else.
Here is the database structure:
CREATE TABLE `messages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`date` date DEFAULT NULL,
`time` time DEFAULT NULL,
`from` varchar(255) DEFAULT NULL,
`to` varchar(255) DEFAULT NULL,
`subject` varchar(255) DEFAULT NULL,
`regards` varchar(255) DEFAULT NULL,
`memo` text,
`deleted` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;
CREATE TABLE `passwords` (
`id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT,
`password` varchar(40) NOT NULL,
`is_admin_password` char(1) DEFAULT 'N',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
This is my "User" model:
class User extends AppModel {
var $name = 'User';
var $useTable = 'passwords';
}
I'm working on the "Change Password" portion of the website now, which is only accessible to the administrator. The form has a dropdown menu where they choose which password they're changing and then they have to type in the current password, new password, and confirm the new password.
Once the administrator submits the "Change Password" form, the controller checks which password they are changing and then looks up that password in the database to verify that they typed in the correct current password. This is the code that looks up the password:
$this->User->findById($this->data['User']['id'])
For some reason, this is the SQL generated by CakePHP no matter what the $this->data['User']['id'] variable is set to (as long as it's a string):
SELECT `User`.`id`, `User`.`password`, `User`.`is_admin_password` FROM `passwords` AS `User` WHERE `User`.`id` = 1 LIMIT 1
Why is it always looking up ID 1 even when I tell it to look up ID 2? I've also tried changing the "findById" to a regular "find" and that didn't change anything. It seems to only be when I use the "id" field as the condition. Why is this happening?
Your passwords table has its id field defined as tinyint(1) i.e. it can only ever be 0 or 1. CakePHP is doing the right thing.
A bit off topic, but what would happen if one day your client asks you to have a third type of role, meaning not administrator and not what you call today 'everyone else' ? With your database structure it would be difficult to do that.
Personaly I would start with a standard users datatable (i.e. with a username), and well, ok, if you are asked to never display it, well, never display it in the view, but this would be really much more evolutive because the database would be ready for more functionnalities.
And by the way, the fact that you called the model for the 'passwords' datatable 'User' makes me think that your are not far from thinking the same ;-)
Just my two cents...
In my application, I have a "user" table that has the following structure.
CREATE TABLE IF NOT EXISTS `users` (
`userId` int(10) unsigned NOT NULL auto_increment,
`username` varchar(128) NOT NULL default '',
`password` varchar(32) NOT NULL default '',
`email` text NOT NULL,
`newsletter` tinyint(1) NOT NULL default '0',
`banned` enum('yes','no') NOT NULL default 'no',
`admin` enum('yes','no') NOT NULL default 'no',
`signup_ip` varchar(20) NOT NULL default '',
`activation_key` varchar(60) NOT NULL default '',
`resetpassword_key` varchar(60) NOT NULL default '',
`createdon` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;
I want to implement social login via Facebook, Twitter, and OpenID in my application, just like Stack Overflow did.
I would suggest that you introduce the concept of an AuthenticationProvider:
CREATE TABLE IF NOT EXISTS `AuthenticationProvider` (
`ProviderKey` varchar(128) NOT NULL,
`userId` int(10) unsigned NOT NULL,
`ProviderType` enum('facebook','twitter', 'google') NOT NULL,
PRIMARY KEY (`ProviderKey`) )
ENGINE=MyISAM DEFAULT CHARSET=latin1;
Each login provider provides a unique key for the user. This is stored in ProviderKey. The ProviderType contains information about which login provider this ProviderKey belongs to, and finally, the userId column couples the information with the users table. So when you receive a succesful login from one of the login providers you find the corresponding ProviderKey in the table and use set the authentication cookie for the user in question.
I'm not sure that you want the ProviderType to be an enum. It would probably be more correct to make another table that could hold these.
When a user first registers with your site, and logs in via Facebook, for example, you will have to create a row in the users table. However, there will be no password, activation_key and resetpassword_key involved. So you may want to move those fields to a separate table, such that your users table only contains the core user data, and no data that is only relevant for a single login mechanism (username/password).
I hope this makes sense and that it points you in the right direction.
/Klaus