how to run mysql v5.5 on redhat linux - mysql

I am new to both linux and also mysql but somehow by obtaining help from net I have installed mysql v5.5 on redhat. It starts fine, I have confirmed this by running command:
"/etc/init.d/mysqld status"
But I am not able to change password using command:
mysqladmin -u root password 'new-password'
It gives error : bash: mysqladmin: command not found.
I tried searching mysqladmin by using command "find / -name mysqladmin" but it returned no result
All I can search on net is adding to path '/bin:/usr/local/mysql/bin' but directory structure after installation mysql v5.5 has changed. There is no such directory like /usr/bin/local/mysql now.
please help me with how to run mysql after changing root's password.

first of all see what MySQL packages are installed
rpm -qa | grep -i mysql
Second, try using locate in order to find the tool path
BTW,
According to pbone mysqladmin is provided by mysql-client (rather than mysql) as it was on older cackeages

Related

Start MySQL on Mac

I Downloaded MySQL 5.7.10 to my Mac El Capitan 10.11.2 and installed, then started MySQL from Preferences. Then I ran "cd /usr/local/mysql/bin/". Then when I do "ls" I see "mysql". So all looks installed correctly.
I am now following the MySQL tutorial to start a database instance (ultimately I want to run some CREATE TABLE scripts). But, "user$ mysql -u root" gives me -bash: mysql: command not found" .
My final goal is to do my SQL commands against a MySQL instances using an IDE like MySQL Workbench or Jetbrains Datagrip. But I am stumped.
I do not get "mysql> "
Try /usr/local/mysql/bin/mysql -u root. If that works, then you need to alter your $PATH environment variable to include /usr/local/mysql/bin.

mysql command line client for linux

I just installed mysql 5.6 in a new CentOS 7 linux installation. I want to use the mysql command line client that I have been used to using in windows, but I cannot seem to find it. Is there a mysql command line client for linux? If so, how do I make sure that I have it? And how do I open it up in the GUI?
You can open MySql command line utility using following command
mysql -u user_name -p
It will ask for password for user_name. If password is not set call as follows
mysql -u user_name
First make sure the service is running :
sudo systemctl start mysqld
Then make sure to run the security script that will remove some dangerous defaults and lock down access to our database system a little bit.
sudo mysql_secure_installation
Now you can use the command line tool
mysql --user=user_name --password=your_password db_name

Can't connect to MySQL from Cygwin

When I call mysql from cygwin terminal I tried that:
$ mysql -u root -p
Works well from cygwin.bat but doesn't work from the regular shell ..
So I copied mysql.exe from its folder to cygwin/usr/local/bin.
Then I typed which mysql:
$ which mysql
/usr/local/bin/mysql
but still .. mysql doesn't seem to load in cygwin 64 Terminal
I read lots of posts about this issue but couldn't find a proper solution. Anyone has a solution for that?
Why are you not using the cygwins mysql-client (database package)?

Installing MySQL on a mac

i have downloaded and installed mySQL my double clicking on its icon. It was installed successfully.
When i goto startup and preference i see the icon of mysql added and when i click on it i see a screen where it says 'MySQL server instance is running'.
But when i open terminal and cd to /usr/local/mysql and then when i type sudo ./bin/mysqld_safe i was prompted for a password. and i have not added a password when i installed mySQL, so i tried leaving it blank, and then i tried various passwords to login but all attempts failed.
So now i need to know how to login to mySQL via the terminal ?
mysql version - 5.5.24-osx10.6x86_64
my Mac OS - 10.7.3
What I found installing mysql on MacOs, there are a few differences. One is that it installs it without a password. The other thing is that it by default allows for anonymous logins.
Use this to set the password:
mysqladmin -u root -h localhost password yourpassword
You can remove anonymous logins this way:
shell> mysql -u root -p
Enter password: (enter root password here)
mysql> DROP USER ''#'localhost';
mysql> DROP USER ''#'host_name';
The other thing is that I found that the install does not modify the path variable. What I did to run mysql from the command line was to add /usr/local/mysql/bin to path by adding it to /etc/paths or /etc/paths.d . This may be what you need in order to run mysql. Like someone said in the comments, mysqld_safe is one way to start the mysql server, and it seems that is already set to run.
Here are specific instructions to add something to /etc/paths.d
$ cd /etc/paths.d
$ cat > mysql
/usr/local/bin/mysql
(and then type Ctrl-D
that should put a file there)
you may have to sudo if you do not have permissions.
The sudo command, by default, lets anyone in the admin group run a command as root by giving his own password. That's why it asked for your password when you typed "sudo ./bin/mysqld_safe". It has nothing whatsoever to do with mysql.
If you don't have a password, you cannot use sudo in the default configuration. Either give yourself a password, or edit the sudoers file. (I would strongly suggest the former over the latter, especially if you have no idea what sudo does.)
For more information, type "man sudo" (and then "man sudoers") from your Terminal.
Meanwhile, the reason "it says -bash: mysql: command not found when i type mysql in the terminal" is because you've clearly installed it into /usr/local/mysql/bin/mysql, and that isn't on your path. If it were on your path, you could have just done "sudo mysqld_safe" above, instead of "sudo ./bin/mysqld_safe". Since it's not, you have to do "./bin/mysqld_safe".
For more information, consult a good primer on the Unix shell.
Finally, if you've got the mysql daemon running, and are trying to start the client, it's "mysql" that you want to run, not "mysqld_safe".

anyone get mysql workbench 5.2 to work with mamp?

i cannot get mysql workbench 5.2 to work. i have mamp and mamp pro installed and running and no matter what type of connection i try it just wont connect. what can i do?
i have a mac with snow leopard
In MySQL workbench use Connection Method: Local Connection/Pipe and in the setting Socket/Pipe path enter: /Applications/MAMP/tmp/mysql/mysql.sock then enter your root username/password.
There are two tasks that need to be fixed to get MySQL Workbench working with a MAMP installation:
1) The Start/Stop/Status commands for the MySql server need to changed from the Server Instance configuration to the following:
Set the Start MySQL command to:
/Applications/MAMP/bin/startMysql.sh
Set the Stop MySQL command to:
/Applications/MAMP/bin/startMysql.sh
Set the Check MySQL Status command to:
ps xa | grep "/Applications/MAMP/Library/bin/[m]ysqld"
2) The my.cnf file needs to be created manually and the appropriate permissions given through a terminal window:
Utilities -> Terminal
sudo touch /etc/my.cnf
sudo chown joeb /etc/my.cnf
Changed joeb with your username.
If you want a more detailed guide, see MAMP, MySQL Workbench, WordPress installation and setup guide for MAC.
I follwed these instructions and got it to work: http://chrischarlton.us/tip/using-mysql-workbench-mamp-pro