cmd - Access denied error for accessing MySQL database -
hi i'm trying play around mysql database , i'm not sure how should go in creating database or tables. surfed internet stack overflow 1 hour , tried few solutions ended nothing below errors. forgot password too. please
unable create new database command create user 'user1'@'localhost';
welcome mysql monitor. commands end ; or \g. mysql connection id 4 server version: 5.6.19 mysql community server (gpl) copyright (c) 2000, 2014, oracle and/or affiliates. rights reserved. oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners. type 'help;' or '\h' help. type '\c' clear current input statement. mysql> show databases; +--------------------+ | database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec) mysql> create user 'newuser'@'localhost' identified 'password'; error 1227 (42000): access denied; need (at least 1 of) create user pr ivilege(s) operation mysql> mysql> create user 'user1'@'localhost'; error 1227 (42000): access denied; need (at least 1 of) create user privilege(s) operation mysql>
you need select first on db preform change using command use
use test;
.in order create database use following syntax
create database dbname;
for creating tables syntax such
create table pet (name varchar(20), owner varchar(20), species varchar(20), sex char(1), birth date, death date);
(taken mysql documentations)i don't know on user connected mysql db if not have privileges create new user , grant new user appropriate privileges
Comments
Post a Comment