I am a a newbie to database programming and I want to try out MySQL.
I just installed MySQL from the official website, I am running mac 10.8.2.
Anyways, whenever I try to run a simple command like $>mysql.server start
it says Permission denied.
I am able to open it through sudo but I would love to get this fixed as this is annoying me, that it wont work properly. I have been searching for the last two hours without finding a fix, so I was hoping anyone could give me a helping hand.
The easiest way is to install the MySQL Startup Item. Then you get a Preference pane for MySQL.
See http://dev.mysql.com/doc/refman/5.5/en/macosx-installation-startupitem.html for full instructions.
Re your comment:
It's often required for services like mysql.server need to run as a uid other than your user login. For instance, the MySQL data directory may only be writeable by the mysql uid. So starting such a service must be done from a user that can change the uid of the process. The root uid can do that, so it's necessary to use sudo to launch service processes like mysql.server.
TL;DR: YOU HAVE TO USE SUDO.
If you a absolute newbie to MYSQL and you just want to use the MYSQL server to test your code on you local MAC I would advice you to take a look at XAMPP / MAMP. Xampp offers a complete out of the box install for everything you need for a development servers (Apache server, MySQL, PHP, etc). Note, that I XAMPP / MAMP is not suitable for production server setting.
I personally use the XAMPP Windows version. I haven't tried MAMP but I have come across it many times . The XAMPP for Mac version seem not to have been update for a while so I suggest you give MAMP a try.
You could of course try to get your current install to work but that might require some work. Also with regard to firewall / security issues. With the out of the box version you will have to do a lot less. Why reinvent the wheel if you can easily install a out of the box version.
Related
I didn't get option to set root password of mysql during installation. Now, I am unable to form instance I am beginner in mysql I have tried reinstallating the software watching youtube still didn't got that option.
Actually I had solved this problem the day after posting this question.. My main problem was I was not getting wizard for saving information regarding root password port and etc. I figured after installing quite a few time that I have been clicking on update before the actual product installation as that was first question before installing... Not having previous verison of mysql I was unable to get root wizard i.e I was able to install product but while create database or server I was having trouble with password because it was not set while installation process... Clicking on no before installation for update solved my issue
This might be useful if you have installed mySql community server.
Download MySQL Installer from here if you haven't already, then open the installer and you might see some products listed in the section, then click on reconfigure of mySQL Server, it will take you through the instructions of setting up few things including your password(which you'll probably find after clicking "next" a few windows).
When I start MAMP in one user account the Apache and MySQL servers start correctly but in another account only the Apache server starts.
The computer has a number of applications installed but nothing else. Any idea what difference I should be looking for between the two accounts?
MAMP 4.2.1 installed on a Mac running High Sierra (10.13). Hard drive securely erased and clean install of MacOS 10.13.
If I understand your question right, you have two user accounts which you want to use for Apache and MySQL server but one of them isn't able to run MySQL.
Looks like it is a user permission issue. You need to add and grant user the proper access in MySQL. Check these links:
MySQL: https://dev.mysql.com/doc/refman/5.7/en/adding-users.html
Apache: http://ifmeister.com/mamp-file-permissions-for-a-local-development-environment/
I've been stupid enough to delete too many databases in XAMPP with PHPMyAdmin and now my sites on localhost don't run properly anymore. Please see this screenshot of the main errors
I guess entirely reinstalling XAMPP will fix the problem but that might take much more time than necessary. Preferably, I'd like to just reinstall the MySQL component or perhaps recreate/repair some databases required for XAMPP to function properly. However, it looks as if I can only reinstall XAMPP entirely instead of separate components (and if that's correct, it's probably for a reason...).
Do I have a better option here than a complete reinstall of XAMPP?
OK, fixed it with the kind help of scones.
1) By default (XAMPP 1.8.1 on Windows XP), there seems to be a folder C:\xampp\mysql\backup\phpmyadmin. Just copy-paste this entire folder into C:\xampp\mysql\data.
2) Stop and restart MySQL
3) If you're using WordPress, your pages may be blank since it may think there are no themes available. Go to [frontpage url]/wp-admin/. Now just reactivate the theme you'd like to use and all seems up and running again!
You dropped the database for PHPMyAdmin. If you can just restore that (with a command line mysql tool or any tool that does not rely on a web-interface), you can use phpmyadmin again.
I recently upgraded to Mountain Lion from Snow Leopard, and in doing so threw my entire local development environment into disarray. I solved the majority of my issues by finally installing MAMP Pro (I was previously using the "native" methods provided by Apple). The problem I have now is I still can't access my old mysql databases. I can view the "new" databases via phpmyadmin in MAMP, but I have old projects that I'd like to work on.
My old databases still exist in /usr/local/mysql/data, but they don't appear in phpmyadmin or even if I query via Terminal (after logging in to mysql & using the show databases; command). I'm sure the answer involves just a few simple commands, but I'm mainly a front-end guy, and I can't for the life of me find the solution on the internets.
Thanks.
UPDATE:
Just a reference for anyone else who might have this issue (or something similar). In order to do the dump, I ended up having to turn off MAMP's instance of MySQL, and starting up the old version (through System Preferences). Otherwise I was getting 1049 errors ("unknown database"), I suppose since it was looking at the new databases instead? Really out of my element here, if you can't tell...
Either way, now it looks like it actually doesn't matter if the MAMP version is active or not. Maybe I just needed to restart all instances of MySQL? Seriously, no clue, but all is good now...
Try this in terminal to dump old databases (replacing [text]):
/usr/local/mysql/bin/mysqldump -u root -p[pass] [db] > [filename].sql
Once you have the sql file you can import it back in with PHPMyAdmin within MAMP.
On occasion, my local Rails app loses its connection to MySQL. I get some error that the connection failed, but if I just refresh the page, it works fine. This has never happpened in my STAGE or PROD environments (I deploy to Ubuntu), so it has not been that big a deal.
Does this happen to anybody else? Is there something I can do to fix it? Is it MySQL or Ruby?
Look like the best solution to this is to install the platform specific mysql driver. sudo gem install mysql
I remember having this problem a while back (before i upgraded to Leopard?). They're tricky to diagnose, but have a look at logfiles, and try setting "wait_timeout" longer (you shouldn't have to mess with "max_connections". See:
http://www.mysqlperformanceblog.com/2008/08/23/how-to-track-down-the-source-of-aborted_connects/
http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html
http://www.softwareprojects.com/resources/programming/t-how-to-fix-mysql-database-myisam-innodb-1634.html
I think i followed Dan Benjamin's MySql install blog to not have problems:
http://hivelogic.com/articles/installing-mysql-on-mac-os-x/