Access root for newly installed MySQL on nitrousio box? - mysql

EDIT- Turns out to be a silly question. The solution:
mysql -u root Don't put a -p as there is no password for fresh installs of MySQL root.
Original Question:
Autoparts just came out recently on nitrous: http://blog.nitrous.io/2013/09/18/introducing-autoparts-for-nitrous-io.html
and I ran the command $ parts install mysql to install mySQL...works great!
Now, how do I access mysql to setup a root user or other users?
mysql> CREATE DATABASE django_db;
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'django_db'
mysql> GRANT ALL ON django_db.* TO 'djangouser'#'localhost' IDENTIFIED BY 'mypassword';
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'django_db'
I don't know how to access mysql -u root -p because I don't know the root password, so I just used mysql to access the mysql from the terminal.
My end goal is to have the mysql setup on my box for a development and testing for my django web application.

Related

unable to create database in mysql or via ssh

I m trying to create new database through mysql or ssh but on both m getting error
mysql : CREATE DATABASE porto;
Error : Access denied for user 'root'#'localhost' to database 'porto' on ssh : ERROR 1044 (42000): Access denied for user 'root'#'localhost' to database 'porto'
mysql> CREATE USER 'testuser'#'localhost' IDENTIFIED BY 'ecomaddon#42';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
mysql> SELECT User,Host From mysql.user;
ERROR 1142 (42000): SELECT command denied to user 'root'#'localhost' for table 'user'
Its problem of privilege but don't know how give root user all privilege ai had try all methods but got nothing.
You can try to access as root
mysql -h 127.0.0.1 -P 3306 -u root -p
If it still does not work follow this guide
https://www.a2hosting.com/kb/developer-corner/mysql/managing-mysql-databases-and-users-from-the-command-line
you may be login as root but the root#localhost is not allowed for the actions you are executing.
mysql>CREATE USER 'root'#'localhost' IDENTIFIED BY 'enter_your_password_here';
mysql>exit
then try logging-in again
I think it's rights issue & It can be resolved by re configuring again. Here's a steps to reconfigure it.
Stop the current MySQL server instance:
sudo service mysql stop
Use dpkg to re-run the configuration process that MySQL goes through on first installation. You will again be asked to set a root password.
sudo dpkg-reconfigure mysql-server-5.5
Thanks for reply to all
i had solve i
1. first login to new user.
2. give access all to that users by update command .
3. drop root user and rename second user to root.
main problem was : when we create root it didn't give grant_priv field access users .

Installed MySQL Server on Mac OSX 10.7.5, receiving a 1045 (28000) error when trying to access MySQL

Relatively new to SQL, I am reaching out for any advice on how to access MySQL via the Terminal shell on a MAC OSX 10.7.5 system. I have gotten this far detailed in the script below, and followed all installation guides on the web, as well as doing a fair amount of troubleshooting to try and move past the "ACCESS DENIED to "KV88#localhost, PASWORD: NO".
Can anyone provide insight on to why I can't input regular MySQL syntax and access the server, I believe I am still stuck in the BASH script environment.
SCRIPT:
ClickAways-MacBook:~ KV88$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Starting MySQL database server
ClickAways-MacBook:~ KV88$ /usr/local/mysql/bin/mysql
ERROR 1045 (28000): Access denied for user 'KV88'#'localhost' (using password: NO)
ClickAways-MacBook:~ KV88$
Thanks in advance
During the installation you had to be asked about root password. So, you can access the server like this:
mysql -u root -p
and input your password. Then give access to your user:
GRANT ALL PRIVLIEGES ON *.* TO 'KV88'#'%' IDENTIFIED BY "<password>";
if you want for a user to be able to do (almost) everything, or create a database under root and give access to this database:
CREATE DATABASE mydb;
GRANT ALL PRIVLIEGES ON mydb.* TO 'KV88'#'%' IDENTIFIED BY '<password>';
Then exit mysql and enter as a user:
mysql -u KV88 -p
or
mysql -u KV88 -p mydb

How to create mysql database using command prompt? I'm getting error ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'ivs'

I want to create database in mysql I installed MySQL 5.6 in windows 8, During installation installer never asked me username or password. When I'm executing command "create database ivs;" it gives me following error:
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'ivs' what can I do now?
You have use the default User and not root. The default User dosent have enough right to Create Databases. Start the Client with root User
c:> mysql -uroot
After great discussion with #Bernd Buffen I got solution for my problem, when I use 'create database ivs' I actually not logged in with 'root' user (I'm logged in with guest user) so to change this to root I use following command:
C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysql -uroot
and then I use
mysql> create database ivs; to create database named 'ivs'

Use mysql having access to the server by ssh

I must have tried every answer in stackoverflow for this problem, nothing works. Anyway:
I installed successfully mariadb 10 on centos 6.5, now I was trying to create database and all those things when I stumbled upon: Access denied for user ''#'localhost' to database 'mysql'. I seem to try logging in anonymously but I am really trying as root.
I logged in typing:
mysql -u root -p
Enter password: [none]
it entered and after I tried using mysql database:
MariaDB [(none)]> use mysql;
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'mysql'
I tried this locally by opening a tunnel in ssh as well
ssh -L 3306:localhost:3306 dev#machine.com
didn't work, also tried in bash...nothing works. Any other advice?

MySQL server access denied while connecting

I have installed Mysql on Mac os 10.7 using dmg installer, it got installed at location /usr/local/mysql I also installed MySQL.prefpane, where I can start and stop the server using services.
i am facing below problems.
mysql> create database test ;
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'ets'
same happens when I am trying to invoke mysql by using below command
./mysql -u root root
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
Even when I created a connection using Eclipse to mysql db then also I got similar kind of exception.
Just want to know after installation do I need to make any further configuration related to user management and access privileges?
Try this,
./mysql -uroot -pPassword
To give the user all priviliges, execute this command:
GRANT ALL PRIVILEGES ON *.* TO root#'%' IDENTIFIED BY PASSWORD 'yourpassword' WITH GRANT OPTION
Also try
CREATE SCHEMA test;