0

I'm trying to install my first community MySQL server instance and seems to be stuck on symlink not working. I'm following the procedure for installing MySQLfrom Installing MySQL on Unix/Linux Using Generic Binaries.

OSVersion: RHEL 7 MySQLVersion: 8

The executable binary is sitting in following folder:

/usr/local/mysql-8.0.19-linux-glibc2.12-x86_64

I created symlink via this command:

pwd
/usr/local
sudo ln -s /usr/local/mysql-8.0.3-rc-linux-glibc2.12-x86_64 /usr/local/mysql
cd mysql

and ran this command to initialize user with ./ and / nothing seems to work.

-bash-4.2$ ./bin/mysqld --initialize --user=mysql
-bash: ./bin/mysqld: No such file or directory
-bash-4.2$ /bin/mysqld --initialize --user=mysql
-bash: /bin/mysqld: No such file or directory
-bash-4.2$

Here's how the symlink is looking: enter image description here

I wonder where am I wrong? Any guidance would be appreciated as I'm stuck with this issue since yesterday.

Tried this and it didn't worked either:

    -bash-4.2$ export PATH=$PATH:/usr/local/mysql/bin
    -bash-4.2$ echo $PATH
    /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/mysql/bin
    -bash-4.2$ mysqld --initialize --user=mysql
    -bash: mysqld: command not found
    -bash-4.2$
    -bash-4.2$ sudo ./bin/mysqld --initialize --user=mysql
     Command not found
    -bash-4.2$
    -bash-4.2$ sudo ./mysqld --initialize --user=mysql
     Command not found
    -bash-4.2$
New contributor
Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • A far easier way to do this is to add the MySQL repo and install it that way. You haven't stated which distro that you are using, but if it's RHEL 8, CentOS 8 or Ubuntu 19, MySQL 8 is in the regular repos. – Nasir Riley Mar 26 at 1:10
  • @NasirRiley Repo is not an option as the server is not connected to the internet. I will update the question with OS Version. – Ali Mar 26 at 1:14
  • 1
    You can download the RPMs and put them on the machine in the same way that you got the other files on the machine and then install them. – Nasir Riley Mar 26 at 2:28
  • @NasirRiley, I was indeed thinking of going that route but wanted to see if I can find out if I can troubleshoot this issue. I think here the installation is not the main issue but symlink is causing trouble as the commands are unable to read from the source and I'm not sure what is causing it. I created the symlink by providing the full path and it should work. – Ali Mar 26 at 2:41
  • In the time that you've waited for a way to fix it, you could have download the RPMs, put them on the machine, and installed them. – Nasir Riley Mar 26 at 2:43
0

You might have missed the last one instruction, where it is being added into the $PATH:

export PATH=$PATH:/usr/local/mysql/bin

This goes into file ~/.bashrc.

Because then one can simply call it directly (at least after a reboot):

mysqld --initialize --user=mysql

... which then resolves to:

/usr/local/mysql/bin/mysqld --initialize --user=mysql
  • I tried that and it didn't work. Added the commands at the end of my question and the output. Rebooted the system as well. – Ali Mar 26 at 5:59
  • Also as an fyi, when I'm logged in as mysql user then I can't seem to find the .bashrc file but when I sudo as root I can cat the .bashrc file. cat .bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi – Ali Mar 26 at 6:24
  • @Ali obviously you should login as root or prefix the input with sudo. The instructions probably do not state at all to login as mysql and this user usually should not even have a login shell. If it really should be that difficult for you, just follow the above suggestion and download the RPM to an USB stick. – Martin Zeitler Mar 27 at 2:58
  • yes I tried as root as well and I still can't get through this issue exactly the same issue. – Ali Mar 27 at 3:06

Your Answer

Ali is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.