Home Programming
What is disabled by default is remote root access. If you want to enable that, run this SQL command locally:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
And then find the following line and comment it out in your my.cnf file, which usually lives on /etc/mysql/my.cnf on Unix/OSX systems. In some cases the location for the file is /etc/mysql/mysql.conf.d/mysqld.cnf).
If it's a Windows system, you can find it in the MySQL installation directory, usually something like C:\Program Files\MySQL\MySQL Server 5.5\ and the filename will be my.ini.
Change line
bind-address = 127.0.0.1
to
#bind-address = 127.0.0.1
And restart the MySQL server (Unix/OSX, and Windows) for the changes to take effect.
if this not working. check the 3306 port.
sudo ufw status
run this command to enable port
sudo ufw allow 3306
restart mysql
Sometime after you install binary, example composer and package from composer. You must add composer to PATH, so many tutorial export PATH but is temporarly. Then how to add the path permanent.
sudo nano /etc/paths
echo $PATH
How to import mysql database from command prompt is easy. sometime it use for big database and problem with phpMyAdmin. But if you have SQL Remote Client you can used that to import database.
to import from command prompt, first you must go to folder mysql instaled. got to bin folder and type this command
mysql -u your_mysql_username_here -p name_of_database < file_dump_here.sqland than type your mysql password
Sometime a web apps need to upload file, and sometime need to write file, or make a folder, and if your apps can't write file or create a folder on unix server maybe your apps folder still on root owner, change to www-data or add www-data to group.
sudo chown -R www-data:www-data /var/www/sites
sudo chmod u=rx,g=rx,o= /var/www/sites
sudo chmod u=rwx,g=rwx,o= /var/www/sites/files
sudo chmod u=r,g=r,o= /var/www/sites/default/*.php
How to detect php.ini on mac,
easy to detect php.ini folder. you can use 2 way.
1. create file info.php and put this script
<?php
phpinfo();
?>
php -i | grep php.ini
on (release) { if (_root.clickTag.substr(0,5) == "http:") { getURL(_root.clickTag, "_blank"); } }
struct nama_tipe_strukturatau
{
.....elemen_struktur;
.....elemen_struktur;
.....elemen_struktur;
};
struct
{
.....elemen_struktur;
.....elemen_struktur;
.....elemen_struktur;
}nama_tipe_struktur;
Pemrograman berorientasi objek