- Ri Xu Online
- Change the life in a geek way
- Configure LAMP ( Apache, MySQL, PHP ) on RedHat Enterprise Linux 6
- Redhat Enterprise Linux (RHEL) Install and Configure MySQL Database Server
- Red Hat Enterprise Linux install Mysql database server
- Redhat Enterprise Linux – RHEL 5 / 6 MySQL installation
- Redhat Enterprise Linux – RHEL 4/3 MySQL installation
- Start MySQL Service
- Setup the mysql root password
- Test the mysql connectivity
- Configure the mysql server
- See also
Ri Xu Online
Change the life in a geek way
Configure LAMP ( Apache, MySQL, PHP ) on RedHat Enterprise Linux 6
Red Hat Enterprise Linux (RHEL) is a Linux-based operating system developed by Red Hat and targeted toward the commercial market. Red Hat Enterprise Linux is released in server versions for x86, x86-64, Itanium, PowerPC and IBM System z, and desktop versions for x86 and x86-64. All of Red Hat’s official support and training and the Red Hat Certification Program center around the Red Hat Enterprise Linux platform. Red Hat Enterprise Linux is often abbreviated to RHEL, although this is not an official designation.
The first version of Red Hat Enterprise Linux to bear the name originally came onto the market as «Red Hat Linux Advanced Server». In 2003 Red Hat rebranded Red Hat Linux Advanced Server to «Red Hat Enterprise Linux AS», and added two more variants, Red Hat Enterprise Linux ES and Red Hat Enterprise Linux WS.
While Red Hat uses strict trademark rules to restrict free re-distribution of their officially supported versions of Red Hat Enterprise Linux, Red Hat freely provides the source code for the distribution’s software even for software where this is not mandatory. As a result, several distributors have created re-branded and/or community-supported re-builds of Red Hat Enterprise Linux that can legally be made available, without official support from Red Hat. CentOS and Oracle Linux aim to provide 100% binary compatibility with Red Hat Enterprise Linux.
Redhat Official Website www.redhat.com
Part 1 System and software preparation
System Version RedHat Enterprise Linux 6.0 ( Santiago )
Kernel version 2.6.32-71.el6.x86_64
Part 2 Erection YUM repository
Since Redhat’s yum online updates for a fee, if it is not registered can not be used, that can not install the software online
2.1 Delete the original redhat yum source
2.2 Download new yum install package ( Using CentOS YUM source )
2.3 Install YUM package
Note: The last two installation package put together to be installed, otherwise it will prompt interdependence, the installation fails.
2.4 Change yum source ( We use www.163.com’s CentOS mirror source )
Edit the file, the file inside the $ releasever replace all the version number (6), save! Or directly to copy the following codes to CentOS6-Base-163.repo file can be (has been modified)
2.5 Clean the yum cache
Part 3 Installation LAMP
3.1 Installation Apache, MySQL, PHP
3.2 Install MySQL extension
3.3 Install PHP extension
3.4 Install Apache extension
3.5 Configuration services
3.6 Set mysql database root account password ( quotation marks filled password )
Источник
Redhat Enterprise Linux (RHEL) Install and Configure MySQL Database Server
H ow do I install the MySQL database server under Redhat Enterprise Linux 4 / 5 / 6?
You can install mysql using any one of the following medium.
a) Install MySQL package using RHN or CentOS repo.
b) Install MySQL rpms from CD/DVD media.
Red Hat Enterprise Linux install Mysql database server
Type the following command to install mysql server using the RHN or CentOS repo:
Redhat Enterprise Linux – RHEL 5 / 6 MySQL installation
Type the following command as root user:
# yum install mysql-server mysql
Redhat Enterprise Linux – RHEL 4/3 MySQL installation
Type the following command as root user:
# up2date mysql-server mysql
Start MySQL Service
To start the mysql server type the following command:
# chkconfig mysqld on
# /etc/init.d/mysqld start
Setup the mysql root password
Type the following command to setup a password for root user:
# mysqladmin -u root password NEWPASSWORD
Test the mysql connectivity
Type the following command to connect to MySQL server:
$ mysql -u root -p
Configure the mysql server
Edit /etc/my.cnf, enter (please note that following are sample values, you need to adjust them as per your requirements):
# vi /etc/my.cnf
You can configure mysql query cache as follows (add in [mysqld] section) to speed up mysql:
You can setup MyISAM buffer size and recover options:
Log slow queries for troubleshooting as follows:
Set caches and other limits as follows:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Save and close the file. You can reload or restart the changes as follows:
# /sbin/service mysqld restart
OR
# /sbin/service mysqld reload
See also
- See all mysql related FAQs and blog posts for more information.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
how to install mysql on Redhat Enterprise Linux 5?
create a yum in rhel 5 and then install the sql package using the following command
yum install mysql-*
Type the following command as root user:
# yum *install * mysql-server mysql
Thanks for the heads up.
/.my.cnf with this content:
[client]
user=”root”
pass=”NEWPASSWORD”
How to Install MySQL rpm from CD/DVD ?
i can’t use RHN
put ur Dvd/cd
login into server
#mount /dev/dvd /mnt
#cd /mnt
mnt#ls
show the details login into server
mnt#cd Server
Server#rpm -ivh mysql
#
thank u very much for the information its very useful for my application.
I want install MySQL from DVD but I can’t install MySQL .
I use command “yum install mysql -server mysql” . It is show message
Loading “securityW plugin
Loading “rhnplugin” plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
No package mysql -server available.
No package mysql available.
Nothing to do
What command is to use intall MySQL ? Please tell me .
Thank you
1.Create YUM locally and than execute yum install mysql* it won’t need any internet connection. And will solve all dependency.
If will go for Manuall RPM installation than it would be a hectic task to solve dependency.
you can disable the gpgchek in /etc/yum.repos.d/yourrepo.
after that you run again command
yum repolist. or you can read my blog in section create local repository.
Maybe it could help you.
Thanks.
after installation what shoul we do to configure my sql
where can i download themes for ubuntu?
anyone please help me
when am starting mysql
]$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
its giving like this
]$ mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
what will the problem and what will be ans to recover it please help m,e
When you don’t remember root password and enter a wrong password, you will get the following MySQL error message.
# mysql -u root mysql
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
1. Stop MySQL Server
As a first step, stop the mysql server using one of the following method.
# service mysql stop
# /etc/rc.d/init.d/mysql stop
2. Add –skip-grant-tables to mysqld_safe Startup Command
Open the mysql startup script and add -skip-grant-tables as shown below.
# vi /etc/rc.d/init.d/mysql
Old Line: $bindir/mysqld_safe –datadir=$datadir –pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
New Line: $bindir/mysqld_safe –skip-grant-tables –datadir=$datadir –pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
3. Start MySQL Server With –skip-grant-tables
Start the mysql server with skip-grant-tables option, which will allow anybody to login to mysql without entering a password.
# service mysql start
Starting MySQL. [ OK ]
[Note: This is using the updated /etc/rc.d/init.d/mysql script]
4. Login Using MySQL Root User Without Entering Password
Since you’ve skipped the grant table, this time when you try to login to mysql, it will not ask for password.
# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.25-rc-community MySQL Community Server (GPL)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
[Note: MySQL did not ask for any password]
Fix: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
if you are new to installing mysql server you might probably face this error quite often if you type mysql in the shell prompt.
> mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
First start the mysql daemon, then type mysql
> /etc/init.d/mysqld start
> mysql
Bingo! It worked for me!
To update mysql root password
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘new-password’) WHERE user=’root’;
mysql> FLUSH PRIVILEGES;
To add a new user to mysql
1. First login as root then create a database ‘demo’
> mysql -u root -p
Enter password:
mysql> create database demo;
After that create a new user named ‘guest’ with password ‘guest’ with all previleges assigned to demo database;
mysql> GRANT ALL PRIVILEGES ON mytest.* TO ‘guest’@’localhost’ IDENTIFIED BY ‘guest’ WITH GRANT OPTION;
Then exit mysql and connect through username guest;
That should work!
i try to use yum install and it gives this message that says “Existing lock /var/run/yum.pid: another copy is running as pid 3406.
Another app is currently holding the yum lock; waiting for it to exit…”
what can i do to make thing right.
if any help please help me.
open the file with vi /var/run/yum.pid and then remove pid 3406 which is inside that.
I used yum install mysql-server mysql and it installed great. Then I tried to start the server with this: /etc/init.d/mysqld start andd it said mysqld doesn’t exist. I should mention that I’m installing this on a work machine, running REHL5 and I don’t have root permissions. I do have sudo rights. I asked whereis MySQL and it returned 4 locations. How do I start the server or configure it so I can start it? Thanks for your help.
Use sudo to start mysql.
I’ve actually tried every sudo start mysql command that I’ve found and not been successful. Its funny because it was no problem from my windows install but this red hat enterprise install isn’t making sense.
Correct syntax to start / stop / restart with sudo:
sudo /etc/init.d/mysqld start
sudo /etc/init.d/mysqld status
sudo /etc/init.d/mysqld restart
sudo /etc/init.d/mysqld stop
OR
sudo /sbin/service mysqld start
What is the output of the following command?
netstat -tulnp | grep mysql
I did sudo netstat -tulnp | grep mysql and it went back to the prompt after requesting password. Without sudo, it said “(No info could be read for “-p”: getuid()=45717 but you should be root.)
sudo /sbin/service mysqld start
returned: mysqld: unrecongnized service
sudo /etc/init.d/mysqld start
returned: sudo: /etc/init.d/mysqld: command not found
sudo /etc/init.d/mysqld status
returned: sudo: /etc/init.d/mysqld: command not found
sudo /etc/init.d/mysqld restart
returned: sudo: /etc/init.d/mysqld: command not found
sudo /etc/init.d/mysqld stop
returned: sudo: /etc/init.d/mysqld: command not found
This is my first foray into RHEL, I’ve used Ubuntu previously (about 2 years ago), and recently been running mysql/apache with XAMPP sucessfully, and that’s not a production platform (as you know). But I have a project that I would like to run on a Linux box (production), for obvious reasons (well, obvious to me). I appreciate your help with this.
So, update – I found that I needed to install something else: mysql-devel. Now that that is there, I ran sudo /usr/bin/mysqld_safe & and that was successful. However, when I run sudo /etc/init.d/mysqld status it returns this:
mysqld dead but subsys locked
Another way to start mysql server. I suggest you reboot your box and type the same command again. It should clean up lock files. It is possible to get rid of problem online but you need to go thorugh kill, rm and other commands.
I could not get the required information about installation of MYSQL on redhat enterprise 5
How to config LDAP in redhat linux
I have installed mysql on rhel 5.4
# yum install *sql*
* start service & create root admin password
# /etc/init.d/mysqld restart
# chkconfig mysqld on
# sqladmin -u root password shirish
am new in mysql installation.
I want to build master slave please any one help me o this….
Thanks
Shirish Shukla
Thank U Very Much !
I sovled my problem with your ways !
Thanks Again !
Thanks! It worked for me 🙂
hai
there i got a problem in installing orcale dba in rhel 5.4
plz give the solution
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-05-30_03-28-30AM. Please wait …
Error in writing to directory /tmp/OraInstall2011-05-30_03-28-30AM. Please ensure that this directory is writable and has atleast 60 MB of disk space. Installation cannot continue.
hai i got error when installing oracle dba on rhel 5.4 any other steps…
—————————————————————>
[root@rhel5 database]# ./runInstaller
Starting Oracle Universal Installer…
Checking installer requirements…
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-05-30_03-28-30AM. Please wait …
Error in writing to directory /tmp/OraInstall2011-05-30_03-28-30AM. Please ensure that this directory is writable and has atleast 60 MB of disk space. Installation cannot continue.
: No such file or directory
Hi,
when i entered this command
mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
i could not solve the issue, pls help me
can i have complete installation and configuration of mysql server and connectivity between client (linux as well as windows) ?
1] which version for PHP,Apache and Mysql is better to install on red hat linux and fedora?
2] when i will save the setup for all the S/w on rhel of any folder then is it right that i can type the command on terminal for the installing?
reply me for this quesions.
i am new in the linux redhat 6.0. i install oracle 11g in my system but give lots of error
sir can give me step by step installation information
Источник