We use MySQL a lot with Oracle SQLDeveloper and many use SQLDeveloper to co-exist between MySQL and Oracle.
For most versions of Oracle Linux, we will install SQL Server from the Yum repository. If you dont have one set up you can configure one under /etc/yum.repos.d. These notes for yum are a reference (blatant copy) from the Oracle Linux Admin guide
- As
root
, change directory to/etc/yum.repos.d
.#
cd /etc/yum.repos.d
- Use the
wget
utility to download the repository configuration file that is appropriate for your system.#
wget http://public-yum.oracle.com/public-yum-
release
.repoFor Oracle Linux 6, enter:#
wget http://public-yum.oracle.com/public-yum-ol6.repo
The/etc/yum.repos.d
directory is updated with the repository configuration file, in this example,public-yum-ol6.repo
. - You can enable or disable repositories in the file by setting the value of the
enabled
directive to 1 or 0 as required.
root@localEl5# yum install mysql-server
You can see if its installed by doingroot@localEl5> yum list mysql-server
Loaded plugins: security
el5_latest | 1.4 kB 00:00
Installed Packages
mysql-server.i386 5.0.95-5.el5_9 installed
root@localEl5>
You can then start it withroot@localEL5> /etc/init.d/mysqld start
and check its running byroot@localEL5> /etc/init.d/mysqld status
mysqld (pid 31298) is running...
root@localEL5> /etc/init.d/mysqld stop
root@localEL5> /etc/init.d/mysqld status
root@localEL5> mysqld_safe --skip-grant-tables &
mysql -uroot
Now we are logged into mysql as root with no passwords. We can check what users are here and what permissions they have. Now, in this case, I have
mysql> select user, host, password from user;
+-------+-------------+-------------------------------------------+
| user | host | password |
+-------+--------------+-------------------------------------------+
| root | localhost | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
| root | 192.168.1.201| *2447D497B9A6A15F2776055CB2D1E9F86758182F |
| barry | localhost | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
+-------+--------------+-------------------------------------------+
The first thing I want to do is to remove duplicate entries for my usermysql> delete from user where user='root' and host ='192.168.1.201';
now we have
+-------+--------------+-------------------------------------------+
| user | host | password |
+-------+--------------+-------------------------------------------+
| root | localhost | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
| barry | localhost | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
+-------+--------------+-------------------------------------------+
Now, next I want to update the hosts to any host which is '%' in mysql
mysql> update user set host='%';
which now gives me
+-------+------+-------------------------------------------+
| user | host | password |
+-------+------+-------------------------------------------+
| root | % | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
| barry | % | *2447D497B9A6A15F2776055CB2D1E9F86758182F |
+-------+------+-------------------------------------------+
2 rows in set (0.00 sec)
old_passwords=0
secure-auth=1
mysql> update user set password=PASSWORD('oracle') where user='root';
lastly flush privileges and exit
mysql> flush privileges;
export MYSQL_PS1="\u@\h [\d] > "
root@localEl5> mysql -uroot -poracle -Dmysql
giving this prompt in mysql
root@localEL5 [mysql] >
Add a comment