how can I run mysql if I installed it from MAMP - php

So I looked at this question Find out where MySQL is installed on Mac OS X
I have MAMP installed and when I run: /Applications/MAMP/Library/bin/mysql --version It gives me correct output for mysql version.
But if I run type -a mysql it says that it wasn't found, as if I don't have mysql installed.
If I want to run mysql from the terminal I can start my MAMP server, then go to MAMP's library and run ./mysql which will start a mysql session.
HOWEVER: I do NOT want to run it using the current MAMP's server I have. i.e Is there a way to run mysql from any directory, like without using MAMP at all?

I downloaded mysql from mysql site http://www.mysql.com and I can run either the one on my MAMP'S server or the one locally on my machine. I just need to decide which of the two since both are running locally.

you should run the daemon manually but you need to setup the data before that by doing something like data directory initialization mysqld

Related

Ubuntu / SQL Server - PHP script works in terminal, but not web application

I have an Ubuntu VM / Azure SQL DB combo where I have two sets of PHP files.
1) Some scripts that run from CRON jobs
2) A Yii2 Framework website
Both environments connect to an SQL Server database.
I have done all the steps to compile sqlsrv and added it to PHP's list of extensions. My scripts work great from the terminal, but on the website, I get an error:
could not find driver
My webserver is nginx, and it runs the website properly, but PDO does not connect to SQL Server.
I only have one PHP installation, but nevertheless used code to determine which is the right php.ini file in use and it has the right extensions directive.
A phpinfo() output also shows sqlsrv in the 'Registered PHP Streams' section.
My UFW firewall is inactive and I don't have SUSELinux. Nevertheless ports 22 and 80 are open. Even tried enabling it.
I am not sure what else to try. Help!
EDIT
I created a simple test file. When I run that through the terminal, it works, but when I do so via a browser, it doesn't.
EDIT 2
I installed Apache2 instead of nginx, and everything works now.
I think you need to try with just some "Hello world". If this not help type in terminal:
sudo apt-get install php-mysql
And restart your nginx server with:
sudo killall nginx && /usr/local/nginx/sbin/nginx

Execute export command in windows

Hello I am trying to execute this command:
export PATH="$HOME/.composer/vendor/bin:$PATH"
in windows.
Please, check these notes
Note: For the local PHP environment I am using a Mac and Valet because it automatically sets up everything. If you are on Windows, you should consider Homestead or some flavor of a virtual machine.

How to run mysql commands from terminal on a MAMP install?

I just installed mamp (xampp) from the mamp.info page and it is working on my mac (both apache, php, phpmyadmin, and mysql). The only problem is when i try to run
mysql -u root -p
Which connects to mamp from the mac os terminal, i get a command error. I have installed and uninstalled mamp and xampp for mac multiple times to no avail.
I am following this tutorial; http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app and i can't get past a certain part because i don't want to use php admin, and i think it'd be cool to use it from the terminal.
My question; how do i configure mamp or xampp for mac to work from the terminal?
Put this at the end of your .bash_profile script (create it if it doesn't already exist):
export PATH=$PATH:/Applications/MAMP/Library/bin

I can not configure MySQL to run from terminal with MAMP

I installed MAMP successfully and it works just fine, apache, phpMyAdmin, etc...and followed a tutorial video on youtube on how to configure MySQL so I can use it with terminal. In short, I created a
.profile
file in my home directory with this data in it:
PATH=$PATH:/Applications/MAMP/Library/bin
export PATH
When I shut everything down and restarted the server and terminal and typed mysql in terminal, this is what I get:
-bash: mysql: command not found
Does anybody have any idea what my problem might be? I'm using MAMP 2.0.
Any help would be appreciated.

MySQL Database won't start XAMPP

I have updated my XAMPP version to 1.8.2. Now I have the problem that the MySQL Database-server won't start.
If I try to start the Apache Web Server (in 'Application manager'), it says "starting..." and after a few seconds it says "Running". When I do the same thing with the MySQL Database, it says "starting..." for a few seconds and then it says "Stopped".
When I look at the config file (my.cnf), I see this:
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
I think the problem is in the socket. mysql.sock does not exist in that directory and not even in the whole XAMPP-directory.
Does anyone know how to fix this?
PS: I have PHP 5.4 installed on OS X.
i had experienced the same error on Mac OS X (10.9) Mavericks i fixed by following these steps
Open terminal and use sudo su
Run ps aux | grep mysql
Kill all process using kill -9 PROCESS_ID
Start your MySQL using control panel
Port 3306 might be used by other process, Can just change the Port number in Xampp mysql configuration and start the mysql.
I had the same experience with xampp but I wasn't performing an update, this was a clean install. I have had good luck running MAMP right out of the box. This isn't exactly a direct answer to your problem, but if you just wanted to install something and get work done, MAMP could be an option. I did a couple of hours of googling and I still haven't figured out the xampp issue here...

Categories