mysql error ubuntu Unknown database - mysql

I am a beginner in linux, I have installed mysql on linux and added 'khalil' as password to root user
when I want to connect :
mysql -u root -p khalil
I need to retype password, when I retype it, I have this error:
ERROR 1049 (42000) : unknown Database 'khalil'
I have the same error when I want to connect to phpmyadmin
1045 Cannot log in to the MySQL server

The command is
mysql -u root -pkhalil
Mind the missing space after -p
However, using a password on the command line can be dangerous (like mysql will warn you too), so consider using
mysql -u root -p
and type the password once you are prompted to.

Related

MYSQLDUMP: Change thing after # symbol

I have the correct parameters for mysqldump:
mysqldump -uUSERNAME -p -hREMOTE_HOST_URL REMOTE_DB_NAME > PATH_TO_DUMP_LOCATION.sql
When I execute the command, I always get Got error 1045 stating that the hostname(?) after the # symbol is incorrect. Ex:Correct_Username#Wrong_Hostname.
How do I change it?
"Exact" command and feedback:
: mysqldump -ujosh -p -hresearch.edu datab > C:\S.sql
mysqldump: Got error: 1045: Access denied for user 'josh'#'josh.vpn.es.edu' (using password: YES) when trying to connect
First check REMOTE_HOST_URL with ping and make sure it's same server where MySQL server is installed or use IP of MySQL server.
then check show grants for 'josh'#'josh.vpn.es.edu'; in MySQL server if you have provided access to user josh to connect from josh.vpn.es.edu.
also verify the password.

can't access mysql in zend server

Abhimanyus-MacBook-Pro:~ abhimanyuaryan$ /usr/local/zend/mysql/bin/mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/usr/local/zend/mysql/tmp/mysql.sock' (2)
I was trying to use MySQL database via terminal using the above command but then this error message showed up. How to fix it?
try bellow command
mysql -u root -h localhost -p
and give the root password
or you can install phpmyadmin and use it directly form the http://localhost/phpmyadmin after installing phpmyadmin.

access denied mysql monitor

I installed xampp on 10.9 mavericks. Unfortunately the command mysql does not work in the terminal. I managed to start the mysql monitor from xamppfiles/bin/. When I try to create a new database I get
ERROR 1044 (42000): Access denied for user ''#'localhost' to database XY
What can I do?
No, you should run mysql -u root -p in bash, not at the MySQL command-line. If you are in mysql, you can exit by typing exit.
You may need to set up a root account for your MySQL database:
In the terminal type:
mysqladmin -u root password 'root password goes here'
And then to invoke the MySQL client:
mysql -h localhost -u root -p

Trying to set MySQL root password results in error

I'm still very new to MySQL and Debian, but have been reading a lot during the last days.
I have a root account to a virtual machine that I want to use for Wordpress. One thing I read was that I should password protect MySQL because by default root user doesn't need a password for it.
I read someone doing it like this:
mysql> mysqladmin -u root password mypassword;
But that gives me the following error:
ERROR 1064 (42000): 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 'mysqladmin -u root password mypassword' at line 1
You are running the command from within mysql, but the command is actually meant to be run directly from the terminal.
mysqladmin -u root password mypassword
If you are already in mysql within terminal, type exit then enter your mysqladmin command.

remote server connect with mysql

I have mysql 5.1 set up and running.
I need to connect to:
location: comm.eng.bxg.com
name: amntxy
user: username
pswd: password
I have tried using
mysql -h amntxy -u username -p
Also tried: use amntxy and use comm.eng.bxg.com/amntxy
But I am unable to connect.
I get the following error:
ERROR 2005 (HY000): Unknown MySQL server host
I also tried mysql_connect but keep getting the error : mysql_connect is not recognized as internal or external command
But I do not understand hwo I can connect here.
Please help.
Thank you
mysql -h comm.eng.bxg.com -u username -p
After this it will ask for a password.
Optionally you can also directly specify the database name that you want:
mysql -h comm.eng.bxg.com -u username -p db_name
But again, this is 100% optional. You will be able to select or change it after with the command USE db_name.