How does Codeigniter know where mysql server is located? - codeigniter

I know this is a very newbie question. So supposed we have a wamp server installed, and downloaded codeigniter. Does the codeigniter find the mysql application through the environmental variable path like it shows on the phpinfo() page? If possible, could you tell me where I can see this configuration within the codeigniter application. The database.php file doesn't seem to have mysql path.

You have to define mysql credentials within application/config/database.php, so codeigniter can connect to your database.
To connect no path is required, instead you have to provide host, username and password.
In your case:
host: localhost
username: root
password: your default root password
Read here: https://ellislab.com/codeigniter/user-guide/database/configuration.html

In general, MySQL server is to install as a Windows Service (Daemon on linux), it can be controlled from the command line, or with the graphical services utility.
PHP interacts with MySQL by connecting to it using TCP/IP. So needless, we have to provide
credentials like hostname, port(default 3306), username ,password etc in order to connect with it. More details can be found here.

Related

Connecting to Oracle data source via DataGrip (HR scheme)

I downloaded schemes from this website (https://github.com/oracle-samples/db-sample-schemas/releases/tag/v21.1)
but I don't know how to work on them in the DataGrip, that is, how to connect and which user data to use for connecting to the Oracle data source (Host, SID, Port, user, password etc)
Thanks in advance!
Schemas are the content.
And you need a place where to place this content.
So, create a database server first. You can do that via Docker or in the cloud.
Here is the Dockerfile you can use to create a docker container with the oracle database running:
https://github.com/DataGrip/docker-env-oracle/blob/master/12.2.0.1/Dockerfile
During installation, you will set the username, password, port etc

Tarantool remote admin console does not ask password

I need to setup remote admin console on tcp(not unix socket) for tarantool.
According to documentation it is provided with console module.
And I added this to my tarantool config:
console.listen("0.0.0.0:3313")
Then I can connect to it via telnet or using tarantoolctl connect.
But I'm not pleased that it is not password protected. Yes I've read the docs.
Is there some possibility to get protected console with password?
The correct way to administer tarantool remotely, with authentication is by opening a regular binary port like this:
box.cfg({listen=3301})
And then connecting to it with tarantoolctl:
tarantoolctl connect admin:password#127.0.0.1:3301
So, connect to the instance through the same host:port you'd use to connect with, say, Python or PHP client.
The console module you refer to isn't meant to be used over TCP. It has support for TCP, but it's essentially plaintext, without any authentication. It is only meant to be used by local user who has root account.

how to run php artisan migrate from within my virtual machine

I've just started with Laravel, installed on WAMP server, and when trying to migrate the first tables, I get and error saying that homeasted#localhost user has no premission, but I dont know how to change it to work on my virtual machine. What should I do?
Please check out Laravels Homestead – it is easy to setup and provides you with a webserver, ready to use and pre-configured for Laravel.
But if you want to use WAMP, you have to:
1) Create a database for your new Laravel installation. Go to your local phpmyadmin, which comes pre-installed with WAMP Server. Login to your database (default username should be 'root', password is blank). There you can manage your databases. Go ahead and create one for your Laravel installation. (There are many tutorials about how to create a database with phpmyadmin)
2) Go to the root directory of your Laravel installation. Open the file called .env.example and fill in your database settings. Then save it to .env. This should get your database connection up and running. Read more about .env in the laravel docs.
If you're using Homestead, you do not need WAMP server. To run migrate command, you need to run vagrant up to start the VM box and then run vagrant ssh command to run SSH. Only after that you should run php artisan migrate command.
Please check here i think that can help you.
https://laracasts.com/discuss/channels/general-discussion/homestead-db-connection-problem
well you can change the table name in .env file which is present in the root directory
If it is not present in there (as it is not available in laravel 5.2) please download it.
Enjoy

Grails Data Source URL for Oracle Database that uses TNS

I'm writing a Groovy/Grails application that will be connecting to an Oracle database that uses TNS names for resolving the actual host. The problem I'm running into is trying to figure out the connection string (called the url in the DataSource.groovy file). I've tried Googling examples, but all the examples I've found so far include the host name, something that I want to avoid since I've been told that this database uses TNS names so that the host can change and the various apps that connect to it won't need to be updated with the new host name.
If someone can provide an example or link that would help me create a connection string using the following details that would be much appreciated.
TNS name: TEST
Username: User
Password: Password
You have to have the host name and the port of the machine that has the listener at least. The actual DB host will be in the TNS file and can be changed without having to change the url string.
jdbc:oracle:thin:User/Password#//myhost:1521/TEST

Copying an existing Magento site to run locally

I am having a hard time running my Magento site website locally using xampp. I have downloaded everything in the public_html to the htdocs folder. It is giving me a n error when i load
SQLSTATE[HY000] [1045] Access denied for user 'mySite_magstore'#'localhost' (using password: YES)
I loaded up the phpmyadmin panel to check the password but it is not loading the one from my website but the new one i have locally. I'm sure I am missing a step here as well.
All the information I have found online is regarding setting up a new site on xampp but could not find anything about using an existing one. Any help or links would help.
Thanks!
If you want to create a test environment in your machine, try the following steps:
Export your live DB
Import it in your local machine
Go in to the core_config_data table and change the 'value' of:
web/unsecure/base_url
And:
web/secure/base_url
To:
http://127.0.0.1/
Go in to:
app/etc/local.xml
And change the username and password to the correct ones
Edit:
Thanks to Cooper Maruyana for bringining this up:
If the previous step doesn't help delete everything in the 'var' folder.
Check your app\etc\local.xml for below line
<password><![CDATA[]]></password>
I am sure you have set some password for production server, but on your local you don't have any password for your root user. So you need to remove that password and also set you base URL in core_config table.
There are two possible options: one is to copy your database from your server to your localhost as pzirkind has illustrated in his answer.
The second option in case you want to use exactly the same database, i.e. you WANT to use your live database:
You need to adjust your app/etc/local.xml file to point to the database server IP address. Currently there should be "localhost" in there. Remove that and put the database server IP address. If you have setup the user on the database to allow remote access (% for scope in phpmyadmin), then this would work, too.
However, I would not recommend this option. I only use it sometimes to share a database between development and staging areas, but never for live sites.
Therefore, I would highly recommend pzirkind's approach!

Resources