MySql Workbench - difference between "Local instance 3306" and "Localhost via pipe"? - mysql

Im learning how to build a simple web app using PHP and MySQL. Tools:
-XAMPP for database, web and php servers
-Sublime for writing the code itself
-Mac OSX Yosemite
- Workbench for database creation
I'm having trouble understanding (and finding a good tutorial) how Workbench actually works. If I got things correctly, I need to create a connection between the Workbench (tool) and the database which sits "inside" the database server? In my case, provided by XAMPP.
After I get these two talking, I then create, edit, etc. tables inside this database, right?
Currently I have two MySql connections on the homescreen, please see attached file.
Thanks!

It's basically just the connection/transfer method. You can connect to a MySQL server via a named pipe if such ability is provided by the operating system OR via TCP connection which is generally for network access but also works and is widely used for localhost connections.
It is transparent to the user and should not affect the communication between server and the client. Those two will connect to the same database using different types of communication channels.

Related

How to access database while not connected to server?

Relevant info: Using Python3, mysql database and mysql connector package for connecting to the database.
I have a program that uses database to get info that it needs and to write to it. On my machine it works well because I'm connected to the local host but on another machine it won't work. Because program will use real server someday, I want to, if program doesn't have access to the server to use copy of a database that will be stored in his files. I'm new to databases and I can't seem to find any remotely relevant info on this. Help on how can I do this or point me in the right direction where to look, thanks.

How can i grant access to mySQL database to other computer within my house?

I'm a beginner in SQL so i'm sorry if the question is too basic.
I just created a database in MySQL Workbench in my computer and i would like to be able to access and modify the database from another computer within my house. I read some solutions but they all require using some external product, is there a way and how can i do this by the MySQL Workbench GUI, or maybe other functionalities from MySQL?
I also installed MySQL community server on the other computer that i would like to connect my database to.
Thanks!
If it's a home network, and both of you are connected via same router, then you can connect to mysql server on the other device using http://ip_of_machine_running_mysql:3306.
ip_of_machine_running_mysql should be the ip of the machine running mysql server.
Worth to note that you need to allow remote connection to mysql if you haven't already done so when you were doing mysql installation.
The steps for enabling remote access differs for your os(windows, ubuntu, mac), but you can easily find tutorials and how to's for changing such configuration.
https://www.brightfunction.co.uk/connecting-to-mysql-server-across-a-local-windows-network/
https://www.techrepublic.com/article/how-to-set-up-mysql-for-remote-access-on-ubuntu-server-16-04/

Unable to find or create new databases using Sequel Pro, but can using phpmyadmin

I am using MAMP Pro and I am having an issue where I cannot find existing databases on Sequel Pro, nor can I create new databases. However, on phpmyadmin, I can see and edit the existing databases and create new ones without any issue. I believe the issue lies with the mysql version on Sequel Pro.
As you can see, on the left, phpmyadmin is running on the MySql server version 5.6.35, as is MAMP Pro, which is in the center of the image. However, Sequel Pro, at the bottom of the image, is running on MySql server version 5.7.18.
I really appreciate any help that can be given, I am close to tearing my hair out!
Thank you!
Clearly the problem is that you're connecting to two different MySQL instances.
Unless you have a good reason to run two MySQL servers on your computer, you should consolidate the databases and remove one. That way you don't get confused when trying to connect. Perhaps you had MAMP installed and also installed another MySQL server; or vice versa. Be careful not to remove the datadir from the MySQL server you're using though, and take backups before you do anything. That's aside from the actual problem, anyway.
You can use the STATUS SQL command to see the connection information — it looks like Sequel Pro is connected via a socket, and STATUS will tell you the path to the socket. Run the command from phpMyAdmin as well to see how it's connecting (it's going to be socket or TCP/IP networking); you can the configure Sequel Pro to connect using the same connection settings phpMyAdmin is using. You could, if you really wanted to, run multiple MySQL instances alongside each other and configure your clients to connect to the proper one (phpMyAdmin at least allows connecting to multiple servers, I assume Sequel pro does as well). You'd use either a different socket or different network port numbers for each server instance — as well as a different datadir for each, since MySQL would not deal well with sharing the data between different versions of the server, especially if they're running concurrently.
To summarize, tell Sequel Pro to connect using the same settings phpMyAdmin is using.
EDIT:
You've determined that MAMP and phpMyAdmin are connecting via the socket /Applications/MAMP/tmp/mysql/mysql.sock — which means they're using the MySQL installed by MAMP (presumably you've installed another MySQL server independently of that). From the Sequel Pro "QUICK CONNECT" page, click over to the "Socket" tab and enter the correct socket like so:
I believe the "Name" field can be anything you prefer, although I don't really know this software program.
If you every use other software, try to remember that '127.0.0.1' and 'localhost' are two very different things to MySQL; the first one always implies using TCP/IP networking and the latter uses sockets (Sequel Pro seems to deal correctly with it so it's not relevant on this connection screen). You, of course, want 'localhost' since you're using sockets.

MySQL Should the connection shown in Workbench read “Local instance MySQL57” or “MySQL57”?

Specific Question: In a 2-3 week process of learning MySQL and attempting to get a Python stock info scrapping program to feed data into a MySQL schema (database, table) I’m having serious difficulties with connections. Having been bitten by doing something wrong & having to re-install MySQL about 8 times now, I’m getting rightfully leery of just about everything in the installation process. Thus this question:
Is “Local instance MySQL” which shows up in the upper left corner of the first (black) MySQL Workbench screen the proper one to use to connect to the database?
As a follow-up,
What is the difference between the windows service MySQL57, the connection MySQL57, and Local instance MySQL57?
During the very painful process of trying to get MySQL up and running, I think I've gotten further when with a fresh installation the first screen reads “MySQL57” as opposed to “Local instance …”
My setup parameters are pretty vanilla with the exception that I’m putting the MySQL program on my D: drive as opposed to the C: drive (an SSD reserved for the operating sys).
System: Windows 8 64bit on a Xeon Ivy Bridge processor, large SSD’s, large HD’s, mucho RAM, dual X-fired video cards, ASUS Sabertooth MB (self-built a yr ago)
Software: MySQL 5.7, complete installation except for module for Visual Basic and Python3 (running 2.7). Attempting to use the above hardware as both a server & client.
Even though I did my first Fortran programming in 1964, and spent my career on Unix machines, please regard me as a newbie when it come to the jargon associated with databases and client/server communications.
Why am I asking this question? My “down the road question” will be about getting data from Python into the MySQL table, but “first things first” --- I would like to get a nice clean installation that I can trust.
By the way, I’ve thoroughly scoured this site and many others but have not found any answers that fit my requirements; they’re either for a non-Windows environment, too full of jargon for me to understand, or too simplistic to be useful.
TIA, Doug
Seems there's some confusion about certain terms. So let's have a look at each:
MySQL is a server application that you can install and connect to via
TCP/IP (on any platform), named pipes (on Windows) or sockets (on
*nix like platforms). This server is totally independent and has no name or such for identification.
A Windows service to run the MySQL server: this is just a helper to allow running the server when your machine starts up. A service is not strictly necessary to run a MySQL server but without it you would have to manually start/stop the server. You can create as many service entries for a server as you want, but usually it makes no sense to create more than one. Since there can be more than one server (each with an own service) on the box it is highly recommended to give the services speaking names (like MySQL57 for a 5.7 MySQL server, MySQL56 or a 5.6 server etc.).
MySQL Workbench connections are entries that store parameters to connect to a MySQL server. They are not tied to a specific service in general (you can connect to a non-Windows server too), but might be associated with such a service if they are configured for a local server (on a Windows machine) and you want to be able to start/stop this server from within MySQL Workbench (see Administrator section). They use the service name to act on a particular service (you configure that in the Connection manager, System profile). On Windows MySQL Workbench attempts to find installed service (to help new users to get up and running quicker) when it is started and no connection is currently defined. It then automatically creates a connection for each service it found (it uses "mysql*" as pattern to search for services). You can retrigger this process by removing all connections and restart MySQL Workbench.
The created connnections (like the “Local instance MySQL”) appear as tile you can simply click to open that connection. Be aware that clicking on the rightmost 1/4 of the tile will open an information popup only, not open the connection as such.
Now to your question:
What is the difference between the windows service MySQL57, the
connection MySQL57, and Local instance MySQL57?
I don't understand where you see a connection MySQL57. There's usually only a service MySQL57 and connection in MySQL Workbench to the server this service is for involved.
I'm also not sure why this is such a dreadful process for you. Especially for Windows a lot of effort has been put into an easy installation experience. The normal process should be like:
Download the MySQL Installer
Run the installer. Select a typical scenario from the presets or select the individual products you want to have installed, say, a MySQL server + MySQL Workbench.
The installer will download and install the selected components.
Configure your server (like giving it a proper service name, TCP/IP port etc.).
After finishing the installer you start MySQL Workbench and can immediately work with your new server (as described above MySQL Workbench picks up the service automatically).
Depending on your download speed this should be something like a 5 - 10 mins. process.
HTH
with due respect sir , windows service mysql is a service created by windows upon successful to help you start / stop mysql. You can use Local Instance Mysql57 without a glitch, as that is just a way of MySQL representing your local mysql instance in the workbench.

What is a MySQL Server Instance?

I'm trying to understand what is meant by a Server Instance in MySQL. Googling for the term "MySQL Server Instance" reveals nothing, and the only reference I can find in the documentation refers to using the New Server Instance Wizard, but doesn't seem to explain why I'd ever want to use this.
Coming from a Microsoft SQL Server background, a (named) instance is a completely separate and isolated installation of the server, running in its own process and on its own port. However, in MySQL a (server) instance seems to be a different beast, as for starters it seems to use the same port as my "existing" "instance".
From the Home page of MySQL Workbench, I have the option on the right hand side to create a New Server Instance. What is a MySQL Server Instance, and why would I ever want to create a new one?
A server instance is a MySQL server running somewhere, and also how to connect to it. See the reference manual, which says:
A server instance is created to provide a way of connecting to a server to be managed.
Though it is somewhat circular, it makes sense from configuring the control manager's connection options where one can choose to connect to any number of MySQL servers, or connect to the same server in several different ways (like through a VPN or secondary network).
From this it appears each instance actually does have its own port judging from this guide to setting up an additional instance:
http://www.ducea.com/2009/01/19/running-multiple-instances-of-mysql-on-the-same-machine/
I'm not sure how this interacts in terms of named pipes on Windows though.