I'm having trouble getting mysql commands to work because, for some reason, it can't find the directory to the mysql files even though the path listed is correct.
Here is what I get when I enter $PATH:
-bash: /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/mysql/bin: No such file or directory
However, I can CD into that path, and the files are listed there. How come they cannot be found?
Thanks
Related
Starting on PHP/MySQL Development and as the title states, downloaded MySQL 8.0.15 DMG. Installed. However, when I attempt to run the terminal command:
"sudo /usr/local/mysql/support-files/mysql.server.start"
I get:
"Starting MysQl .......... "
which finally ends in:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/Macbook.hsd.comcast.net.pid)
So far I have tried:
Tried to remove the "Macbook.hsd.comcast.net.pid" file located in the data directory but all i keep getting a "No Such file or directory"
To look for default "my.cnf" file to mod or to add the default values, HOWEVER I read that: "By default the OS X installation does not use a my.cnf, and My SQL just uses the default values. To set up your own my.cnf, you could just create a file straight in /etc.
An "auto.cnf" exists in the data folder, i'm not sure if MySQL uses that or would respect a "my.cnf" created in the /usr/local/sql/data/ folder.
I'm not sure of the proper location to create a "my.cnf" (see, all I want to do is set the proper value for the "pid-file" such as pid-file = /var/run/mysqld/mysqld.pid and then create the directory and give it the proper permissions. SEE UPDATE AT BOTTOM:
I'm cannot access the "data" folder in MySQL folder (which is alias of): "/usr/local/mysql-8.0.15-macos10.14-x86_64/". It keeps telling me I don't have permission. There is a little red dot
I have set checked the permissions in "/user/local/mysql/" and did a
"sudo chown -RL root:mysql /user/local/mysql"
"sudo chown -RL _mysql:mysql /usr/local/mysql/data"
In the /mysql/ directory now everything reads:
Stumped and not sure where to move on from here.
Is the fact that I can't access the data folder a result because I haven't made one/specified one? Can't seem to find an answer for getting MySQL working with HighSierra/Mojave. I can't believe that it's just dead.
I would appreciate any/all help.
UPDATE/EDIT:
Was able to add my user permissions to the "/user/local/mysql/data" folder and was finally able to access the error file ("Macbook.hsd.comcast.net.err") and a "auto.cnf".
The "auto.cnf" file is empty besides a single line: [auto] server-uuid=e7986494-331d-11e9-9691-bec9b3249da6 (not sure if I need to modify the auto.cnf and add PID entries). See error BELOW which seems to indicate otherwise.
The Error file had repeated Errors (occurred several Times):
A long time ago when I installed mysql I symlinked the term mysql to /usr/local/mysql/bin/mysql.
Recently I removed mysql completely and used homebrew to reinstall it. Now the term mysql supposedly points to nothing, which is fine, but I can't unlink it. Typing mysql into terminal returns
-bash: /usr/local/mysql/bin/mysql: No such file or directory
and unlink mysql returns
unlink: mysql: No such file or directory
Any idea how to fix this?
I found out how to fix it - There was an alias set in my bash profile which is a hidden file located in my home folder, removing alias set in the that file finally worked.
I have this code but I can' figure out how to change the C:/ drive to an equivalent of linux. Below is the code:
SELECT * INTO OUTFILE 'C:/CountryLanguage.txt' FROM CountryLanuage;
I have tried doing '/student', '/home', '/usr', and just plain '/CountryLanguage' I am not sure what to do. Can someone please help me?
Thanks,
Well, this depends on where you would like to save the file.
If you would like to save it in for example "/student" you'll first have to create this folder in the root folder "/". Creating a folder is done by typing:
cd /
mkdir students
Once the directory is created you can make sure it's there by typing:
ls /
Which display all the files and folders in /.
ls /students
Displays all the files in the /students folder.
Since this is in the Linux root you'll have to change the permissions for the folder so that MySQL can write to it. This by typing:
chmod 777 /students
You shall only use 777 for testing since this allows everyone to read, write and execute in that folder but i advise using this to make sure it's not the permissions causing an error.
EDIT:
If you don't have root access to the system you should try saving your file to "/var/lib/mysql/" where MySQL can write.
This is listed in my .bash_profile
PATH="/usr/local/mysql/bin:/Applications/MAMP/Library/bin:$PATH"
export PATH
After applying those changes with ". .bash_profile", "which mysql" only outputs
/usr/local/mysql/bin
How do i get mysql to also look at /Applications/MAMP/... ?
Thanks in advance.
What is happening here is that mysql/bin is listed before the MAMP bin folder. The path is being evaluated from left to right, meaning that because which found mysql in the mysql/bin folder it is returning that one, without ever processing the other directories.
If you want the mysql binary to be found from the MAMP binary folder, then switch the order of your PATH to PATH="/Applications/MAMP/Library/bin:/usr/local/mysql/bin:$PATH"
So I installed XAMPP (in Ubuntu), and it was successful,
the location of MYSQL is on, /opt/lampp/bin/mysql, and so I have to include the entire path to access mysql as seen below:
$/opt/lampp/bin/mysql -u root -p
And it can login.
But using just "mysql" isn't working; it says not found.
Can you give me an idea on how to set env't variable for mysql?
New in Ubuntu. help? :(
in your home directory there's a file called .bash_profile (use ls -la to see it because files starting with . are by default hidden
There will probably already be a line similar to this one:
PATH=$PATH:$HOME/bin
Change it to
PATH=$PATH:$HOME/bin:/opt/lampp/bin/
This is the easiest way, there are other ways to eg do this so that all users on the system will automatically get this directory in their path, for more detailed answers go to our sister site askubuntu.com