any ide how to connect to my local mysql wamp server from another computer? Not in lan. For e.g. connect to 81.182.127.107, or see the phpmyadmin using 81.182.127.107phpmyadmin?
There are two ways to connect to a mysql server:
direct connection, eg. via database software or from your source code
via a local installed user interface, usually phpmyadmin which is a local hosted website.
mysql is bound to the local addresses by default. To change open the my.conf, and comment the bind-address: 127.0.0.1 like this:
#bind-address: 127.0.0.1
This will allow direct access to the mysql server from outside.
If you want to use phpmyadmin, you also need a webserver, which is apache by default at WAMP. There in the root web dir, phpmyadmin should be already installed, if not you need to install and configure it.
After this, http://ip-from-pc/phpmyadmin should bring you the user interface to your local mysql server.
Related
Is it possible to create a local database on my home-computer for MYSQL workbench?
This server is only for my own use. Not to the outside community.
Download XAMPP on your machine and install it. (Windows)
After successful installation, you will be able to see an icon on your toolbar.
Click on it and start Apache, MySQL and if anything you need.
Open browser, type : localhost/phpmyadmmin
This will give you an GUI to manage databases locally on your machine. XAMPP basically provides you local server.
If this is what you are looking for, after creating a database in MySQL from your local machine, then that you could access the database through MySQL workbench as a local instance. It asks you to authenticate based on your MySQL conf though. Just the normal way!
You can download WAMP (Apache, Mysql, PHP) server on Windows.
Then add new connection in workbench.
host:127.0.0.1
username:root
password:<Empty>
i have installed MySQL server with developer default, I can connect to database with local application, How ever i am not able to connect to database from other system on the network it saying unable to reach database. I access database with root user and password
please give me steps to configure my MySQL server so that i can access database from any system in my network
You will have to create a user allowing him to connect from any host ('user'#'%') and use that user to connect to your MySQL server machine. Also, you'll have to set bind-address of your MySQL configuration to your server machine's IP.
Check the following article. Although it is for Linux environment, you can get the general idea of what is to be done.
https://rtcamp.com/tutorials/mysql/remote-access/
I am working on a school project in which I have to upload data onto a database hosted on phpMyAdmin.
What's confusing me right now is that I see "localhost" at the top of the page and before I even query the database I see "Run SQL query/queries on server "localhost":"
Does this mean that I'm hosting a server on my computer and accessing the database through that? Because then I query for "SHOW VARIABLES WHERE Variable_name = 'hostname';" and it returns with hostname = webhost330. (It is hosted on webhost330.asu.edu).
I'm extremely confused about what this means. Thanks for any possible help.
I'm very new to databases so forgive me if I'm missing something simple here.
EDIT: To clarify: I'm not at school, I'm at my house. What kind of implications does this have? In other words, what's the difference between this and hosting a database locally?
When I host a database on my computer through the MySQL command line client, I can create database information and it's stored on my computer in files. Does this mean that it's initially stored on localhost and then that data is used to create files on my computer?
And then the equivalent of that for the webhost330 is that the localhost stores the database initially but then uploads it to the host at phpMyAdmin? That is the primary thing I'm confused about.
This exactly means what you assumed. When connected to localhost, you are connected to local MySQL server on same machine. Using webhost330.... you are connected to that remote MySQL server instance, if that is not the name of your own machine. Your own server can be webhost30.etcetc.
Edit
If your website is hosted here: webhost330.asu.edu then MySQL host either being webhost330.asu.edu or localhost both mean the same local MySQL server on your very machine.
Edit based on your update
If you are at home, then localhost means you are connected to a MySQL server that you have installed on your own computer. and webhost30.etc.etc means you are connected to the database you have at your school. Database do allow remote connectivity and if you are connected to school from home, that's a remote MySQL connection.
To remove your confusion, you should use only localhost in your code. localhost at home will mean the development server which is your home computer, and when you take the same code to webhost30.etc.etc then localhost for that server will mean its own MySQL installation. So localhost will work everywhere as long as you don't want your code to connect to a remote external MySQL database server.
Assuming you're at school, and assuming you're on your school network. Then yes, your machine is probably "webhost330.asu.edu". At the very least webhost330.asu.edu thinks "webhost330.asu.edu" is localhost.
To see what "localhost" refers to in terms of MySQL server, you have to look at the URL you are using to connect to the web server.
For example, if the URL is
http://localhost/phpmyadmin
and this instance of phpMyAdmin tells me that the MySQL server is on localhost, this means that the MySQL server is on my local workstation.
If the URL is http://example.com/phpmyadmin, then localhost will mean that the MySQL server is on the same machine (example.com).
I deployed my Rails app to Amazon EC2 server (Ubuntu), but I am thinking how to connect to MySQL database from terminal (SSL) and manually check data in database.
How to do that? I see in the database.yml file some credentials, but don't know how to connect/log in into MySQL on EC2 instance.
Thanks
There's no special magic involved here. An EC2 server is just... a server. This is not hosting like heroku or godaddy where your database is going to be hosted on a different db server.
Unless you explicitly setup a separate db server (which I don't think you did), you've got an entire virtual machine running Ubuntu, and the db server is most likely running on the same machine.
So you can ssh into the machine and just run the standard mysql client. Docs here: http://dev.mysql.com/doc/refman/5.6/en/mysql.html.
If you want to use some gui software such as sequel pro mentioned in one of the comments, you'll need to open up the ports in the aws console. Amazon closes all the ports by default. Do this to open up the port:
Open up the AWS control panel
Go to 'Security Groups'
Select the security group in the panel (you probably only have one).
Click the 'Inbound' tab.
Select Mysql from the dropdown list
Save the rule
This will open up port 3306 and enable you to use an external tool to see the server.
If you just want to call some sql to the database just to verify small amount of data, you can try doing these:
sql_statement = 'SELECT * FROM users'
ActiveRecord::Base.connection.execute(sql_statement).to_a
I have two servers running on Ubuntu. Server 1 only has MySQL installed and acts as an database. Server 2 is a Apache web server. The database is internal and so as the Apache server and they can ping each other but the database server is not accessible via the internet. I can telnet into the database server from the Apache but I can not connect to the database via PHPMyAdmin.
So the question is how I can configure this to work. I also don't want to allow access to the whole server (databases), access only via user name and password specified.
Thanks!
Define your user as user#[hostip-of-Php-myadmin-server] and you should be set?
It was a BIND issue, it's all fixed now.