Advanced Search
Search Results
92 total results found
Generic
mySql
User administration
Add new user, set password and grant permissions
CREATE USER 'novousuario'@'localhost' IDENTIFIED BY 'password';GRANT ALL PRIVILEGES ON * . * TO 'novousuario'@'localhost';FLUSH PRIVILEGES; CREATE DATABASE nome_da_base_de_dados; CREATE USER 'nome_do_usuario'@'localhost' IDENTIFIED BY 'senha';GRANT ALL PRIVI...
Reset root password
sudo /etc/init.d/mysqld stopsudo /etc/init.d/mysqld statussudo mysqld_safe --skip-grant-tables &mysql -u root use mysql;update user set password=PASSWORD("mynewpassword") where User='root';flush privileges;exit sudo /etc/init.d/mysqld stopsudo /etc/init.d/mysq...
Exporting data
Dumping data
One Insert statement for each data row mysqldump --extended-insert=FALSE
Settings
Store passwords Edit the file ~/.my.cnf and adapt the following code: [client]user=rootpassword="pass" [mysql]user=rootpassword="pass" [mysqldump]user=rootpassword="pass" [mysqldiff]user=rootpassword="pass"
Linux Administration
Boot
Grub
Setting the default runlevel in Ubuntu 16.04 Mapping between runlevels and systemd targetsRunlevel / Target 0: poweroff.target1: rescue.target2, 3, 4: multi-user.target5: graphical.target6: reboot.target To change runlevel: sudo systemctl isolate multi-user....
Bibliography
https://askubuntu.com/questions/788323/change-runlevel-on-16-04http://www.hypexr.org/linux_scp_help.php
File management
Scp file copy examples Copy the file "foobar.txt" from a remote host to the local host$ scp your_username@remotehost.edu:foobar.txt /some/local/directory Copy the file "foobar.txt" from the local host to a remote host$ scp foobar.txt your_username@remotehost.e...
Services
Enabling ssh on Ubuntu sudo apt-get install openssh-server sudo service ssh status Removing the CD / DVD install as a source for apt-get sudo nano /etc/apt/sources.list #comment cdrom line sudo apt-get update
Scripting
Colours on terminal
<?php /* Black 0;30 Blue 0;34 Green 0;32 Cyan 0;36 Red 0;31 Purple 0;35 Brown 0;33 Light Gray 0;37 Dark Gray 1;30 Light Blue 1;34 Light Green 1;32 Light Cyan 1;36 Light Red 1;31 Light Purple 1;35 Yellow 1;33 White 1;37 */ <?php echo "\033[31m some colored t...