Problems installing openEMM on Centos 6 running Plesk 11 - mysql

I am trying to install openEMM on a Centos 6 VDS and have run into a snag. I am following the instructions on this page: http://www.roothelp.net/install-openemm-on-centos-6-x/. Everything has gone along fine until I reached the following commands:
service mysqld start
/usr/bin/mysql_secure_installation
cd /usr/share/doc/OpenEMM-2013/
mysqladmin -u root -p create openemm
The service starts fine, but when I run /usr/bin/mysql_secure_installation I get the following:
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and you
haven't set the root password yet, the password will be blank, so you
should just press enter here.
Enter current password for root (enter for none):
This is where the problems start. Apparently Plesk 11 does not create a root user account, using "admin" instead. None of my passwords work here, neither my actual SSH root password, my admin password, or any other password I've assigned. I even started mysql with this script to ensure I had the correct root password:
>UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
>FLUSH PRIVILEGES;
I tried this to ensure I had the correct password: /usr/local/psa/bin/admin --show-password
None of this has worked, and I am unable to run the command. How can I get around this? If I skip that command (GoDaddy support advised me that it was only configuring MySql, which is already installed with Plesk) and try to run
mysqladmin -u root -p create openemm
I am again asked for a root password and none work. I also tried this command instead, using the admin password but still had the same problem.
mysqladmin -u admin -p create openemm
I suspect I'll have to create a database called openemm through Plesk. Any ideas?

If you haven't set the mysql root password you can set it through the command
`$> mysqladmin -u root password "yourpassword"`
and if you want to change (or update) a root password, then you need to use the following command:
$> mysqladmin -u root -p'oldpassword' password newpass
Then you can create your database. In your case I think the mysql root password is just entered as the secure script asked you.

Related

Reset MySQL / MariaDB password on OSX

I have installed MariaDB via Homebrew after following this guide. It has been working fine, however today the root password has expired and I cannot seem to reset it with any of the —skip-grant-tables —skip-networking type options.
So far I have tried:
brew services stop mariadb
mysqld_safe --skip-grant-tables --skip-networking
mysql_secure_installation
also tried
mysql_secure_installation --connect-expired-password
Which gives me:
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
Password update failed!
Cleaning up...
I've also added:
[mysqld]
default_password_lifetime=0
skip-grant-tables
to /usr/local/etc/my.cnf
Still doesn't let me update the root password with the above commands.
Brew doctor comes back clean and I'm running out of things to try.
Ended up running /usr/local/mysql/bin/mysqladmin -u root -p password and set a new password.
Log in
mysql -uroot
Then do
set password = password("your_password");

Mysql and phpmyadmin installation in RaspberryPi 3

I am trying to install mysql and phpmyadmin in my raspberrypi 3. I have followed many tutorials on the internet and specifically this link
https://www.youtube.com/watch?v=ozo_npQMQS8
now the problem is that while installing mysql i dont get any window in the command line asking for the password hence i am not able to set the root password..
I am able to get into mysql by "sudo"
sudo mysql -u root
but i am not able to login through the password.
the situation is same for the phpmyadmin. the installation is correct but i am not able to login with the password.
Thanks
So i figure out the problem is with the plugin. so i have to set the plugin to mysql_native_password.
To check the plugin type
USE mysql;
SELECT User, Host, plugin FROM mysql.user;
You may see that mysql_native_password is not there..
so to setup you may write these commands..
sudo mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET
plugin='mysql_native_password' WHERE User='root'; mysql> FLUSH
PRIVILEGES; mysql> exit;
$ service mysql restart
So now you will be able to login both in phpmyadmin and in console through root password.
You shouldn't need 'sudo' because the -u in mysql -u root specifies the user account with which to connect (and the 'mysql' command should be available for all users, not just root; if not check your path). The reason you're not being prompted for a password is because you haven't told MySQL to use a password when connecting, to do that use -p like mysql -u root -p.
If you didn't set a password during installation, then there shouldn't be a password in which case mysql -u root should have worked for you. Once you've connected, you could set a password (which you probably ought to do for the two user accounts with username root and host '%' and 'localhost' (there may also be one for an IPv6 address). After setting the password, of course you'll need to use it when logging in with the -p flag.
If you're having trouble with phpMyAdmin, show us the error message and relevant part of your configuration file (config.inc.php).

How can I successfully login with root after running mysql_secure_installation?

I am currently unable to login as root on mysql and I am not quite sure about what's going on. Here's what happened:
I ran mysql_secure_installation as recommended, to secure my mysql installation. Afterwards, I typed the default root password that was asked and then I entered:
No to setting a password for root
Yes on removing anonymous users
Yes on disallowing remote root login
Yes on removing the test database and access to it
Yes on reloading privilege tables
After completing this process, I tried accessing mysql with mysql -u root -p (entered the default password) and received this message:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
Do you have any ideas on what might have went wrong?
I also tried resetting the root password by starting mysql with --skip-grant-tables, but I am still not able to login.
I am using Ubuntu 14.04 and mysql 14.14 (LAMP stack).
I know this is an old post but the main answer is outdated and did not solve my issue.
Below my steps for future reference if anybody is having similar problems.
Stop mysql if it's running
$ sudo service mysql stop
Start mysql in safe mode
$ sudo mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
If you get the error
"mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists"
Just create that folder:
$ mkdir -p /var/run/mysqld
$ chown mysql:mysql /var/run/mysqld
Open a new terminal window and log into mysql service + select mysql database:
$ mysql -u root
mysql> use mysql;
Set new password for root user:
mysql> update user set authentication_string=password('new-password') where user='root';
Flush privileges and exit mysql:
mysql> FLUSH PRIVILEGES;
mysql> exit;
Stop the safemode mysql (from the second terminal, you will see it stop in the first terminal)
$ mysqladmin -u root -p shutdown
Restart mysql
$ sudo service mysql start
You should be able to use the root user with password now to login to mysql/phpmyadmin
CentOS/Redhat:
From what I read in docs, when you run mysql_secure_installation, a temporary root password is generated and is stored in some log file.
sudo grep 'temporary password' /var/log/mysqld.log
Debian/Ubuntu:
During the packages installation, you get a prompt asking for the root password. If you don’t set it up, MySQL’s root user is created without a password. We can read the following line in package installation output:
Shell
2016-05-16T07:27:21.532619Z 1 [Warning] root#localhost is created with
an empty password ! Please consider switching off the
--initialize-insecure option.
but it is configured with the auth_socket plugin. You will only be able to connect using the UNIX socket, therefore any attempt to connect using your local IP or the network fails. Later on, you can change the password to allow connections from the network (as explained in this blog post).
Source
All we can do now is to see the root password. Lets change the root password since you cannot understand hashed password even if we can see it:
sudo service mysql stop
sudo mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
then run mysql in a new terminal
mysql -u root
and run the following query, after changing the password
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES;
quit the mysql safe mode and start mysql service by
mysqladmin shutdown
sudo service mysql start
just run this script by root , you need custormize you password
mysqlpassword=password
/usr/bin/mysqladmin -u root password "$mysqlpassword"
#configure mysql login privileges
echo "grant all privileges on *.* to root#\"localhost\" identified by \"$mysqlpassword\";show databases;" |mysql -u root -p$mysqlpassword

Just installed MySQL. Unable to use any commands. Unknown root password

I tried following this post:
How can I rework my MySQL password so that I can rake db: create on rails?
As it most closely addresses my problem except the answers aren't specific/detailed enough i.e. I am a huge newbie and don't know what commands to run.
This is my problem:
:~/myapp$ rake db:create
Access denied for user 'todallyrad'#'localhost' (using password: YES)Please provide the root password for your mysql installation.
I don't know the root password or how to change it. I got started trying to follow this:
https://gorails.com/setup/ubuntu/14.04
But got stuck at the very end. I tried doing the suggested change of the database.yml file using VIM but that didn't work either.
The default root password for MySQL is no password. Either edit your database.yml file, enter root as user, leave password blank. Or use mysql command line console to create a user with password. And add a root password.
You may change your root password as per below:
STOP mysql service
sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
Login into mysql DB using root user
mysql -u root mysql
Set password for your root user
UPDATE user SET Password=PASSWORD('YOURPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
use root as username and leave password blank for the first time and then when you are log in, you can add account for database connection.

Access denied for root user in MySQL command-line

I've just installed xampp, and am using command line to write mySQL.
I am using 'root' with no password and can connect to mysql but cannot CREATE DATABASE as I get the error 1044 access denied for user '' # 'localhost'. I am logged in as -uroot.
I have privileges in phpMyadmin to do what I want, but, in command line I seem to have no write privileges. I've looked at all the other related posts on this topic but to no avail. I cannot GRANT privileges as I have none anyway.
Are you logging into MySQL as root? You have to explicitly grant privileges to your "regular" MySQL user account while logged in as MySQL root.
First set up a root account for your MySQL database.
In the terminal type:
mysqladmin -u root password 'password'
To log into MySQL, use this:
mysql -u root -p
To set the privileges manually start the server with the skip-grant-tables option, open mysql client and manually update the mysql.user table and/or the mysql.db tables. This can be a tedious task though so if what you need is an account with all privs I would do the following.
Start the server with the skip-grant-tables option
Start mysql client (without a username/password)
Issue the command
flush privileges;
which forces the grant tables to be loaded.
Create a new account with the GRANT command something like this (but replacing username and password with whatever you want to use.
GRANT ALL on *.* to 'username'#'localhost' identified by 'password';
Restart the server in normal mode (without skip-grant-tables) and log in with your newly created account.
Refer this MySQL docs.
navigate do C:\xampp\mysql\bin\ and make sure the file mysql.exe is in that folder.
mysql -uroot -p
if dont have a password just press enter.
the prompt changes to
mysql>
do your mysql commands
By default there is no password is set for root user in XAMPP.
You can set password for root user of MySQL.
Navigate to
localhost:80/security/index.php
and set password for root user.
Note:Please change the port number in above url if your Apache in on different port.
Open XAMPP control panel Click "Shell" button
Command prompt window will open now in that window type
mysql -u root -p;
It will ask for password type the password which you have set for root user.
There you go ur logged in as root user :D Now do what u want to do :P
Gain access to a MariaDB 10 database server
After stopping the database server, the next step is to gain access to the server through a backdoor by starting the database server and skipping networking and permission tables. This can be done by running the commands below.
sudo mysqld_safe --skip-grant-tables --skip-networking &
Reset MariaDB root Password
Now that the database server is started in safe mode, run the commands below to logon as root without password prompt. To do that, run the commands below
sudo mysql -u root
Then run the commands below to use the mysql database.
use mysql;
Finally, run the commands below to reset the root password.
update user set password=PASSWORD("new_password_here") where User='root';
Replace new_password _here with the new password you want to create for the root account, then press Enter.
After that, run the commands below to update the permissions and save your changes to disk.
flush privileges;
Exit (CTRL + D) and you’re done.
Next start MariaDB normally and test the new password you just created.
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
Logon to the database by running the commands below.
sudo mysql -u root -p
source: https://websiteforstudents.com/reset-mariadb-root-password-ubuntu-17-04-17-10/
I had the same issue, and it turned out to be that MariaDB was set to allow only root to log in locally via the unix_socket plug-in, so clearing that setting allowed successfully logging in with the user specified on the command line, provided a correct password is entered, of course.
See this answer on Ask Ubuntu
I re-installed the ODBC connector msi and re-installed mySQL directly (aside from xampp) and it now works. It was a connector problem I think, as SHOW DATABASES wasn't actually showing my databases at all.
My 'root' login wasn't getting access to the DB, which made it seem like it had limited priviliges but it actually wasn't connected properly.
Server file only change name folder
etc/mysql
rename
mysql-
this might help on Ubuntu:
go to /etc/mysql/my.cnf and comment this line:
bind-address = 127.0.0.1
Hope this helps someone, I've been searching for this a while too
Cheers
You mustn't have a space character between -u and the username:
mysql -uroot -p
# or
mysql --user=root --password