Added metadata, moved partials into main text body.
This commit is contained in:
parent
6f2fb769d0
commit
84880de69c
16 changed files with 661 additions and 32 deletions
|
@ -1,7 +1,11 @@
|
|||
ifdef::context[:parent-context: {context}]
|
||||
:context: assembly_installing-java
|
||||
[id="assembly_installing-java"]
|
||||
= Installing Java
|
||||
Héctor Louzao; Ankur Sinha ; alciregi
|
||||
:revnumber: F37
|
||||
:revdate: 2021-02-02
|
||||
:category: Software installation
|
||||
:tags: How-to Programming languages Java
|
||||
//:page-aliases:
|
||||
|
||||
|
||||
Java is a popular programming language that allows you run programs on many platforms, including Fedora.
|
||||
If you want to create Java programs, you need to install a JDK (Java Development Kit).
|
||||
|
@ -25,15 +29,167 @@ You can find the following Versions:
|
|||
|
||||
* Latest
|
||||
|
||||
include::{partialsdir}/proc_installing-openjdk.adoc[leveloffset=+1]
|
||||
|
||||
include::{partialsdir}/proc_installing-oracle-java.adoc[leveloffset=+1]
|
||||
|
||||
include::{partialsdir}/proc_switching-between-java-versions.adoc[leveloffset=+1]
|
||||
== Installing OpenJDK
|
||||
|
||||
To install OpenJDK from the Fedora repository:
|
||||
|
||||
* Run the following command to list available versions:
|
||||
|
||||
----
|
||||
dnf search openjdk
|
||||
----
|
||||
|
||||
* Copy the version of OpenJDK you want to install.
|
||||
|
||||
[NOTE]
|
||||
Various flavors of OpenJDK are available. For information about these options, search the link:https://openjdk.java.net/[OpenJDK web site].
|
||||
|
||||
* Run the following command to install OpenJDK:
|
||||
|
||||
----
|
||||
sudo dnf install <openjdk-package-name>
|
||||
----
|
||||
|
||||
Examples:
|
||||
|
||||
----
|
||||
sudo dnf install java-1.8.0-openjdk.x86_64
|
||||
----
|
||||
|
||||
----
|
||||
sudo dnf install java-11-openjdk.x86_64
|
||||
----
|
||||
|
||||
----
|
||||
sudo dnf install java-latest-openjdk.x86_64
|
||||
----
|
||||
|
||||
=== Installing OpenJDK for development
|
||||
|
||||
In order to install the Java Development Kit, runtime environment and associated development tools.
|
||||
|
||||
----
|
||||
sudo dnf install <openjdk-package-name>-devel
|
||||
----
|
||||
|
||||
Examples:
|
||||
|
||||
----
|
||||
sudo dnf install java-1.8.0-openjdk-devel.x86_64
|
||||
----
|
||||
|
||||
----
|
||||
sudo dnf install java-11-openjdk-devel.x86_64
|
||||
----
|
||||
|
||||
----
|
||||
sudo dnf install java-latest-openjdk-devel.x86_64
|
||||
----
|
||||
|
||||
|
||||
|
||||
== Installing Oracle Java SE
|
||||
|
||||
include::{partialsdir}/3rdparty-message.adoc[]
|
||||
|
||||
To install Oracle Java SE:
|
||||
|
||||
. Navigate to link:https://www.oracle.com/java/technologies/javase-downloads.html[Oracle Java SE downloads page], and choose the version of Java you wish to use.
|
||||
|
||||
. Accept the license agreement and download the appropriate tar.gz file for your systems architecture.
|
||||
|
||||
. Unpack the tar.gz file somewhere.
|
||||
For example, to extract it to the _/opt_ directory:
|
||||
`sudo tar xf Downloads/jdk-18_linux-x64_bin.tar.gz -C /opt`
|
||||
|
||||
. Set the _JAVA_HOME_ environment variable to that directory.
|
||||
For example: `export JAVA_HOME=/opt/jdk-18.0.1.1`
|
||||
|
||||
Note: Always make sure to download latest version available.
|
||||
|
||||
|
||||
|
||||
== Switching between Java Versions
|
||||
|
||||
You might have installed several versions of Java on your system, you can switch from one.
|
||||
|
||||
After running this command, you will see a list of all installed Java versions, select:
|
||||
|
||||
----
|
||||
sudo alternatives --config java
|
||||
----
|
||||
|
||||
Simply enter a selection number to choose which java executable should be used by default.
|
||||
|
||||
* verify:
|
||||
|
||||
----
|
||||
java -version
|
||||
----
|
||||
|
||||
|
||||
|
||||
== JDK reference
|
||||
|
||||
See the following list of Java-related acronyms for reference:
|
||||
|
||||
JRE:: Java Runtime Environment; required to run Java code and applications
|
||||
JVM:: Java Virtual Machine; main component of the JRE
|
||||
JDK:: Java Development Kit; required only for development, coding
|
||||
SDK:: Software Development Kit; see JDK
|
||||
JavaWS:: link:https://en.wikipedia.org/wiki/Java_Web_Start[Java Web Start] is a framework to start application from the Internet
|
||||
JavaFX:: link:https://en.wikipedia.org/wiki/JavaFX[JavaFX] is a platform to create and deliver desktop and Rich Internet Apps
|
||||
OpenJFX:: is the JavaFX Open Source implementation
|
||||
OpenJDK:: Open Source project behind the Java Platform link:https://openjdk.java.net/[openjdk.java.net].
|
||||
IcedTea:: is a support project for OpenJDK (concern only developers) link:http://icedtea.classpath.org/[icedtea.classpath.org]
|
||||
IcedTea-Web:: is the Java Web Start package (contains only JavaWS, no applets anymore); install to run *JNPL* files
|
||||
applets:: are obsolete technology; Not implemented in any recent package
|
||||
JSE, J2SE, JEE, ...:: obsolete acronyms for Java Standard & Enterprise Edition; JavaSE is like JRE
|
||||
|
||||
include::{partialsdir}/ref_jdk-tools.adoc[leveloffset=+1]
|
||||
|
||||
[discrete]
|
||||
=== JDK components
|
||||
|
||||
The JDK has as its primary components a collection of programming tools, including:
|
||||
|
||||
`appletviewer`:: this tool can be used to run and debug Java applets without a web browser
|
||||
`apt`:: the annotation-processing tool
|
||||
`extcheck`:: a utility which can detect JAR-file conflicts
|
||||
`idlj`:: the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.
|
||||
`jabswitch`:: the Java Access Bridge. Exposes assistive technologies on Microsoft Windows systems.
|
||||
`java`:: the loader for Java applications. This tool is an interpreter and can interpret the class files generated by the javac compiler. Now a single launcher is used for both development and deployment. The old deployment launcher, jre, no longer comes with Sun JDK, and instead it has been replaced by this new java loader.
|
||||
`javac`:: the Java compiler, which converts source code into Java bytecode
|
||||
`javadoc`:: the documentation generator, which automatically generates documentation from source code comments
|
||||
`jar`:: the archiver, which packages related class libraries into a single JAR file. This tool also helps manage JAR files.
|
||||
`javafxpackager`:: tool to package and sign JavaFX applications
|
||||
`jarsigner`:: the jar signing and verification tool
|
||||
`javah`:: the C header and stub generator, used to write native methods
|
||||
`javap`:: the class file disassembler
|
||||
`javaws`:: the Java Web Start launcher for JNLP applications
|
||||
`JConsole`:: Java Monitoring and Management Console
|
||||
`jdb`:: the debugger
|
||||
`jhat`:: Java Heap Analysis Tool (experimental)
|
||||
`jinfo`:: This utility gets configuration information from a running Java process or crash dump. (experimental)
|
||||
`jmap`:: This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump. (experimental)
|
||||
`jmc`:: Java Mission Control
|
||||
`jps`:: Java Virtual Machine Process Status Tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. (experimental)
|
||||
`jrunscript`:: Java command-line script shell.
|
||||
`jstack`:: utility which prints Java stack traces of Java threads (experimental)
|
||||
`jstat`:: Java Virtual Machine statistics monitoring tool (experimental)
|
||||
`jstatd`:: jstat daemon (experimental)
|
||||
`keytool`:: tool for manipulating the keystore
|
||||
`pack200`:: JAR compression tool
|
||||
`policytool`:: the policy creation and management tool, which can determine policy for a Java runtime, specifying which permissions are available for code from various sources
|
||||
`VisualVM`:: visual tool integrating several command-line JDK tools and lightweight clarification needed] performance and memory profiling capabilities
|
||||
`wsimport`:: generates portable JAX-WS artifacts for invoking a web service.
|
||||
`xjc`:: Part of the Java API for XML Binding (JAXB) API. It accepts an XML schema and generates Java classes.
|
||||
|
||||
The JDK also comes with a complete Java Runtime Environment, usually called a private runtime, due to the fact that it is separated from the "regular" JRE and has extra contents. It consists of a Java Virtual Machine and all of the class libraries present in the production environment, as well as additional libraries only useful to developers, such as the internationalization libraries and the IDL libraries.
|
||||
|
||||
|
||||
|
||||
== Additional resources
|
||||
|
||||
For Java in Fedora, see:
|
||||
|
@ -54,5 +210,3 @@ To develop Java applications, consider the following open-source IDEs:
|
|||
* link:https://eclipse.org/[Eclipse]
|
||||
* link:https://www.jetbrains.com/idea/[IntelliJ IDEA]
|
||||
|
||||
ifdef::parent-context[:context: {parent-context}]
|
||||
ifndef::parent-context[:!context:]
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
ifdef::context[:parent-context: {context}]
|
||||
:context: assembly_installing-mysql-mariadb
|
||||
= Installing MySQL/MariaDB
|
||||
Alessio ; Héctor Louzao ; Ankur Sinha
|
||||
:revnumber: F37
|
||||
:revdate: 2022-06-10
|
||||
:category: Databases
|
||||
:tags: How-to MySQL MariaDB
|
||||
//:page-aliases:
|
||||
|
||||
|
||||
[abstract]
|
||||
MySQL is a popular RDBMS (Relational Database Management System). MariaDB was born as a fork of MySQL.
|
||||
Nowadays the two products are a little bit different. Migrating data from one system to the other could not be a trivial task.
|
||||
|
||||
|
||||
MariaDB is fully GPLv2 licensed while MySQL has two licensing options, GPLv2 (for the Community edition) and Enterprise.
|
||||
|
||||
In the Fedora repositories you can find:
|
||||
|
@ -17,12 +24,447 @@ NOTE: MariaDB and MySQL packages conflict because they provide similar files. So
|
|||
|
||||
In addition you can also install MySQL commmunity edition (8.0 or 5.7) from the repository maintained by Oracle/MySQL itself.
|
||||
|
||||
include::{partialsdir}/proc_installing-mysql-from-oracle.adoc[leveloffset=+1]
|
||||
include::{partialsdir}/proc_installing-mysql-from-fedora-repo.adoc[leveloffset=+1]
|
||||
include::{partialsdir}/proc_installing-mysql-from-container.adoc[leveloffset=+1]
|
||||
include::{partialsdir}/proc_using-mysql-mariadb.adoc[leveloffset=+1]
|
||||
include::{partialsdir}/proc_expose-outside-mysql.adoc[leveloffset=+1]
|
||||
include::{partialsdir}/proc_troubleshooting-mysql.adoc[leveloffset=+1]
|
||||
|
||||
ifdef::parent-context[:context: {parent-context}]
|
||||
ifndef::parent-context[:!context:]
|
||||
|
||||
//include::{partialsdir}/proc_installing-mysql-from-oracle.adoc[leveloffset=+1]
|
||||
//[id='install-from-oracle-mysql']
|
||||
== Install from Oracle MySQL
|
||||
|
||||
include::{partialsdir}/3rdparty-message.adoc[]
|
||||
|
||||
=== Adding the MySQL repository to Fedora
|
||||
|
||||
Please download the release package provided by Oracle from: https://dev.mysql.com/downloads/repo/yum/
|
||||
Once downloaded, please install it using dnf:
|
||||
|
||||
----
|
||||
sudo dnf install <path to downloaded rpm>
|
||||
----
|
||||
|
||||
Please note that this repository is provided by Oracle
|
||||
so any issues/bugs encountered will need to be reported to them
|
||||
via their communication channels: https://www.mysql.com/about/faq/
|
||||
|
||||
=== Installing MySQL on Fedora
|
||||
|
||||
----
|
||||
sudo dnf install mysql-community-server
|
||||
----
|
||||
|
||||
=== Start MySQL Service and Enable at Loggin:
|
||||
|
||||
----
|
||||
sudo systemctl start mysqld
|
||||
sudo systemctl enable mysqld
|
||||
----
|
||||
|
||||
find Default Password, For security reasons, MySQL generates a temporary root key. Please note that MySQL has even stricter security policies than MariaDB.
|
||||
|
||||
----
|
||||
sudo grep 'temporary password' /var/log/mysqld.log
|
||||
----
|
||||
|
||||
=== Configuring MySQL before the first use
|
||||
|
||||
----
|
||||
sudo mysql_secure_installation
|
||||
----
|
||||
|
||||
Then, answer the security questions as you prefer. or just say **yes** to all of them.
|
||||
|
||||
=== Using MySQL
|
||||
|
||||
----
|
||||
sudo mysql -u root -p
|
||||
----
|
||||
|
||||
=== Removing MySQL
|
||||
|
||||
I suggest to remove in the following way, the most appropriate and safe way without removing many dependencies is:
|
||||
|
||||
----
|
||||
sudo rpm -e --nodeps mysql-community-libs mysql-community-common mysql-community-server
|
||||
----
|
||||
|
||||
|
||||
|
||||
//include::{partialsdir}/proc_installing-mysql-from-fedora-repo.adoc[leveloffset=+1]
|
||||
//[id='install-from-fedora-main-repo']
|
||||
== Install from Fedora Main Repo
|
||||
|
||||
The community provide a MySQL package in the main repo.
|
||||
|
||||
----
|
||||
sudo dnf install {community-mysql-server|mariadb-server}
|
||||
----
|
||||
|
||||
=== Configuring MySQL/MariaDB
|
||||
|
||||
Enable the service at boot and start:
|
||||
|
||||
----
|
||||
sudo systemctl enable {mysqld|mariadb}
|
||||
sudo systemctl start {mysqld|mariadb}
|
||||
----
|
||||
|
||||
=== Installing MariaDB server from the Fedora Modular repository
|
||||
|
||||
To list the available versions (_streams_ in modularity terminology) of MariaDB:
|
||||
|
||||
----
|
||||
dnf module list mariadb
|
||||
----
|
||||
|
||||
To enable the version of MariaDB you want to use and make the stream RPMs available in the package set:
|
||||
|
||||
----
|
||||
sudo dnf module enable mariadb:10.4
|
||||
----
|
||||
|
||||
At this point you can verify that the available RPM provides the 10.4 verison of MariaDB server:
|
||||
|
||||
----
|
||||
dnf list mariadb-server
|
||||
----
|
||||
|
||||
To install MariaDB server:
|
||||
|
||||
----
|
||||
sudo dnf module install mariadb/server
|
||||
----
|
||||
|
||||
With modules, you could also install a specific profile: like client, devel or galera (the multi-master replica).
|
||||
For instance, if you don't want to install the server stuff, but only the client packages:
|
||||
|
||||
----
|
||||
sudo dnf module install mariadb:10.4/client
|
||||
----
|
||||
|
||||
* MariaDB default root password is empty.
|
||||
|
||||
=== Configuring SQL before the first use
|
||||
|
||||
----
|
||||
sudo mysql_secure_installation
|
||||
----
|
||||
|
||||
Some questions will be asked: answer to them as you prefer; answering _yes_ to all of them is perfectly fine.
|
||||
|
||||
=== Using SQL
|
||||
|
||||
----
|
||||
sudo mysql -u root -p
|
||||
----
|
||||
|
||||
=== Removing SQL
|
||||
|
||||
I suggest to remove in the following way:
|
||||
|
||||
----
|
||||
sudo dnf remove {community-mysql-server|mariadb-server}
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
||||
//include::{partialsdir}/proc_installing-mysql-from-container.adoc[leveloffset=+1]
|
||||
//[id='install-from-container']
|
||||
== Install from Podman
|
||||
|
||||
=== Downloading a SQL Server Docker Image
|
||||
|
||||
----
|
||||
podman pull {mysql/mysql-server|mariadb/server}
|
||||
----
|
||||
|
||||
=== See Logs
|
||||
|
||||
----
|
||||
podman logs {mysql|mariadb}
|
||||
----
|
||||
|
||||
=== Starting a MySQL Server Instance
|
||||
|
||||
The command's below contain the random password generated for the root user;
|
||||
|
||||
----
|
||||
podman logs mysql 2>&1 | grep GENERATED
|
||||
----
|
||||
|
||||
----
|
||||
podman -d -e MYSQL_ROOT_PASSWORD=mypassword mysql/mysql-Server
|
||||
----
|
||||
|
||||
=== Starting a MariaDB Server Instance
|
||||
|
||||
----
|
||||
podman run -d --name=mariadb -ed MYSQL_ROOT_PASSWORD=mypassword -d mariadb/server
|
||||
----
|
||||
|
||||
WARNING: Password blank default for MariaDB
|
||||
|
||||
NOTE: The -d option used for _BOTH_ in the podman run command above makes the container run in the background. Use this command to monitor the output from the container:
|
||||
|
||||
=== Connecting to MySQL Server from within the Container
|
||||
|
||||
----
|
||||
podman exec -it mysql mysql -uroot -p
|
||||
----
|
||||
|
||||
you must reset the server root password by issuing this statement:
|
||||
|
||||
----
|
||||
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
|
||||
----
|
||||
|
||||
=== Connecting to MariaDB Server from within the Container
|
||||
|
||||
----
|
||||
podman exec -it mariadb bash
|
||||
----
|
||||
|
||||
=== Reseting SQL_ROOT_PASSWORD
|
||||
|
||||
you must reset the server root password by issuing this statement:
|
||||
|
||||
----
|
||||
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
|
||||
----
|
||||
|
||||
=== Stopping and Deleting a SQL Container
|
||||
|
||||
----
|
||||
podman {start|stop|restart} {mysql|mariadb}
|
||||
----
|
||||
|
||||
=== Deleting a SQL Container
|
||||
|
||||
----
|
||||
podman rm {mysql|mariadb}
|
||||
----
|
||||
|
||||
WARNING: you can do the same with _docker_ just change _podman_ with _docker_.
|
||||
|
||||
|
||||
|
||||
//include::{partialsdir}/proc_using-mysql-mariadb.adoc[leveloffset=+1]
|
||||
== Using the RDBMS
|
||||
|
||||
Connect to the MySQL/MariaDB shell using the `mysql` command.
|
||||
|
||||
For both of them, the command is `mysql`. The syntax an the options are generally the same.
|
||||
|
||||
----
|
||||
$ mysql -u root -p
|
||||
----
|
||||
|
||||
Once gained access to the shell you can get the running version of the software:
|
||||
|
||||
----
|
||||
mysql> SELECT version();
|
||||
----
|
||||
|
||||
You can create a database:
|
||||
|
||||
----
|
||||
mysql> create schema test;
|
||||
----
|
||||
|
||||
Create a user:
|
||||
|
||||
----
|
||||
mysql> GRANT ALL PRIVILEGES ON test.* TO 'my_user'@'localhost' IDENTIFIED BY 'PaSsWoRd';
|
||||
----
|
||||
|
||||
List the available databases:
|
||||
|
||||
----
|
||||
mysql> show schemas;
|
||||
----
|
||||
|
||||
=== Files location
|
||||
|
||||
The database disk storage is located in `/var/lib/mysql`.
|
||||
|
||||
|
||||
== How To Allow Remote Access MySQL/MariaDB/MYSQL Community
|
||||
|
||||
=== Add New Rule to Firewalld
|
||||
|
||||
Open SQL port (3306) on FireWalld:
|
||||
|
||||
----
|
||||
sudo firewall-cmd --permanent --zone=public --add-service=mysql
|
||||
----
|
||||
|
||||
### OR ###
|
||||
|
||||
----
|
||||
sudo firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
----
|
||||
|
||||
=== Restart firewalld.service
|
||||
|
||||
----
|
||||
systemctl restart firewalld.service
|
||||
----
|
||||
|
||||
=== Editing Conf. Files:
|
||||
|
||||
Configuration files:
|
||||
|
||||
* MySQL -> `/etc/my.cnf/`
|
||||
* MySQL Community -> `/etc/my.cnf.d/community-mysql-server.cnf`
|
||||
* MariaDB -> `/etc/my.conf`
|
||||
|
||||
NOTE: you can ensure that with the following command `rpm -qc [package]`.
|
||||
|
||||
Navigate to the line that begins with the bind-address directive. It will look like this:
|
||||
you could set this directive to a wildcard IP address, either *, ::, or 0.0.0.0:
|
||||
|
||||
----
|
||||
bind-address = 0.0.0.0
|
||||
----
|
||||
|
||||
After changing this line, save and close the file and then restart the MySQL service:
|
||||
|
||||
----
|
||||
sudo systemctl restart {mysqld|mariadb}
|
||||
----
|
||||
|
||||
=== Creating a USER
|
||||
|
||||
----
|
||||
CREATE USER 'your_username'@'host_ip_addr' IDENTIFIED BY 'your_password';
|
||||
----
|
||||
|
||||
NOTE: Replace your_username and your_password depending on what you want the username and password to be. Here, host_ip_addr is the hostname or IP address of the computer from where you want to connect to the MySQL/MariaDB server. You can also use % as host_ip_addr if you want to connect from any computer. It can also be something like 192.168.2.% if you want to connect from computers from the IP range 192.168.2.1 – 192.168.2.254.
|
||||
|
||||
=== Allow Access
|
||||
|
||||
----
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'%';
|
||||
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
|
||||
----
|
||||
|
||||
#### OR ####
|
||||
|
||||
It is common for people to want to create a "root" user that can connect from anywhere, so as an example, we'll do just that, but to improve on it we'll create
|
||||
a root user that can connect from anywhere on the local area network (LAN)
|
||||
|
||||
----
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%'
|
||||
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
|
||||
----
|
||||
|
||||
----
|
||||
FLUSH PRIVILEGES;
|
||||
----
|
||||
|
||||
=== Connecting
|
||||
|
||||
----
|
||||
mysql -u [USER] -h [IP] -p
|
||||
----
|
||||
|
||||
|
||||
|
||||
//include::{partialsdir}/proc_troubleshooting-mysql.adoc[leveloffset=+1]
|
||||
//[id='how-to-troubleshoot-issues-in-sql']
|
||||
== How To Troubleshoot Issues in SQL
|
||||
|
||||
Version:
|
||||
|
||||
----
|
||||
dnf list installed | grep -i -e maria -e mysql -e galera
|
||||
----
|
||||
|
||||
Check parameters in configuration file:
|
||||
|
||||
* MySQL:
|
||||
|
||||
----
|
||||
mysqld --print-defaults
|
||||
----
|
||||
|
||||
* MariaDB/MySQL Comunnity:
|
||||
|
||||
----
|
||||
/usr/libexec/mysqld --print-defaults
|
||||
----
|
||||
|
||||
WARNING: Compatiblity between different version are not allowed Just install one of them.
|
||||
|
||||
=== How to Access SQL Error Logs
|
||||
|
||||
Oftentimes, the root cause of slowdowns, crashes, or other unexpected behavior in SQL can
|
||||
In many cases, the error logs are most easily read with the less program, a command line u
|
||||
|
||||
if SQL isn’t behaving as expected, you can obtain more information about the source of the
|
||||
|
||||
* **systemctl status mysqld.service** doesn't start well, This information doesn’t explain
|
||||
well what is happening?, after this command you should type `journalctl -xe -u mariadb -u mysqld`.
|
||||
* Look at Log files, can be located in `/var/log/mysql/mysqld.log` for MySQL, and `/var/log/mariabd` for MariaDB.
|
||||
|
||||
=== How To Troubleshoot Socket Errors in SQL
|
||||
|
||||
SQL manages connections to the database server through the use of a socket file, a special kind of file that facilitates communications between different processes. The MySQL server’s socket file is named mysqld.sock and on Ubuntu systems it’s usually stored in the /var/run/mysqld/ directory. This file is created by the MySQL service automatically.
|
||||
|
||||
Sometimes, changes to your system or your SQL configuration can result in SQL being unable to read the socket file, preventing you from gaining access to your databases. The most common socket error looks like this:
|
||||
|
||||
----
|
||||
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
|
||||
----
|
||||
|
||||
There are a few reasons why this error may occur, and a few potential ways to resolve it.
|
||||
One common cause of this error is that the SQL service is stopped or did not start to begin with, meaning that it was unable to create the socket file in the first place. To find out if this is the reason you’re seeing this error, try starting the service with _systemctl_:
|
||||
|
||||
----
|
||||
sudo systemctl start {mysqld|mariadb}
|
||||
----
|
||||
|
||||
Then try accessing the MySQL prompt again. If you still receive the socket error, double check the location where your MySQL installation is looking for the socket file. This information can be found in the `mysqld.cnf` file:
|
||||
|
||||
look for the socket parameter in the [mysqld] section of this file. It will look like this:
|
||||
|
||||
----
|
||||
[mysqld]
|
||||
user = mysql
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
port = 3306
|
||||
----
|
||||
|
||||
Close this file, then ensure that the mysqld.sock file exists by running an ls command on the directory where SQL expects to find it:
|
||||
|
||||
----
|
||||
ls -a /var/run/mysqld/
|
||||
----
|
||||
|
||||
If the socket file exists, you will see it in this command’s output:
|
||||
|
||||
----
|
||||
mysqld.pid mysqld.sock mysqld.sock.lock
|
||||
----
|
||||
|
||||
if the file does not exist, the reason may be that MySQL is trying to create it, but does not have adequate permissions to do so. You can ensure that the correct permissions are in place by changing the directory’s ownership to the mysql user and group:
|
||||
|
||||
----
|
||||
sudo chown mysql:mysql /var/run/mysqld/
|
||||
----
|
||||
|
||||
Then ensure that the mysql user has the appropriate permissions over the directory. Setting these to 775 will work in most cases:
|
||||
|
||||
----
|
||||
sudo chmod -R 755 /var/run/mysqld/
|
||||
----
|
||||
|
||||
Finally, restart the MySQL service so it can attempt to create the socket file again:
|
||||
|
||||
----
|
||||
sudo systemctl restart {mysqld|mariadb}
|
||||
----
|
||||
|
||||
Then try accessing the MySQL prompt once again. If you still encounter the socket error, there’s likely a deeper issue with your MySQL instance, in which case you should review the error log to see if it can provide any clues.
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ Ankur Sinha ; Héctor Louzao ; The Fedora Docs team
|
|||
:tags: How-to Plugins Multimedia
|
||||
:page-aliases: assembly_installing-plugins-for-playing-movies-and-music.adoc
|
||||
|
||||
[abstract]
|
||||
As a Fedora user and system administrator, you can use these steps to install additional multimedia plugins that enable you to play various video and audio types.
|
||||
|
||||
WARNING: If you live in a country where software patents apply, such as in the United States or in Japan, you need to obtain multimedia codecs from a source that legally distributes patented software in your country. For example, see the Fluendo Codec Pack: link:https://fluendo.com/en/products/enterprise/fluendo-codec-pack/[].
|
||||
|
|
|
@ -1,15 +1,49 @@
|
|||
ifdef::context[:parent-context: {context}]
|
||||
:context: gnome-boxes
|
||||
[id='installing-virtual-operating-systems-with-gnome-boxes-{context}']
|
||||
= Installing virtual operating systems with GNOME Boxes
|
||||
Ankursinha; Brunovernay; Hhlp
|
||||
:revnumber: unknown
|
||||
:revdate: 2021-02-14
|
||||
:category: Multimedia
|
||||
:tags: How-to Screen-recorder
|
||||
:experimental:
|
||||
//:page-aliases:
|
||||
|
||||
:md: en-US/modules
|
||||
:imagesdir: ../images
|
||||
|
||||
[abstract]
|
||||
GNOME Boxes is an application in GNOME Desktop Environment, which enables you to virtually access various operating systems.
|
||||
|
||||
:leveloffset: +1
|
||||
include::{partialsdir}/proc_install-predefined-systems.adoc[]
|
||||
:leveloffset: -1
|
||||
ifdef::parent-context[:context: {parent-context}]
|
||||
ifndef::parent-context[:!context:]
|
||||
== Installing a virtual operating system from the list of predefined systems
|
||||
|
||||
To install a virtual operating system:
|
||||
|
||||
. Run *GNOME Boxes* using the *Super* key and type `Boxes`. In GNOME Boxes, click the *+* button and then *Create a Virtual Machine*.
|
||||
+
|
||||
image::Boxes_new_machine.png[New machine]
|
||||
|
||||
. Download an operating system.
|
||||
+
|
||||
image::Download_os.png[Download your system]
|
||||
|
||||
+
|
||||
Choose one of the predefined systems from the list.
|
||||
+
|
||||
image::Select_virtual_machine.png[Select machine]
|
||||
Alternatively, download an ISO image from the relevant website and select the file as shown in the screen below:
|
||||
+
|
||||
image::Select_from_file.png[Select from file]
|
||||
+
|
||||
. Review your installation.
|
||||
+
|
||||
image::Installation_review.png[Installation review]
|
||||
+
|
||||
To modify resources of the installed virtual operating system, such as RAM or disk size, click the *Customize* button.
|
||||
+
|
||||
image::Customize_resources.png[Customize resources]
|
||||
+
|
||||
. To start the installation of the virtual operating system, click the *Create* button.
|
||||
+
|
||||
The actual installation process may differ based on the selected operating system.
|
||||
+
|
||||
Installed systems are available to run in the main menu of *GNOME Boxes*.
|
||||
+
|
||||
image::Select_from_boxes_menu.png[Select operating system]
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ https://help.gnome.org/users/gnome-help/stable/keyboard-shortcuts-set.html.en
|
|||
|
||||
|
||||
|
||||
|
||||
== Disabling keyboard shortcuts for custom applications in GNOME
|
||||
|
||||
This section describes how to disable a keyboard shortcut for starting a custom application in GNOME.
|
||||
|
@ -114,9 +115,6 @@ image::shortcuts-disabled.png[]
|
|||
|
||||
|
||||
|
||||
|
||||
include::{partialsdir}/proc_enabling-shortcut-custom-app-gnome.adoc[]
|
||||
[id='enabling-shortcut-custom-app-gnome']
|
||||
== Enabling keyboard shortcuts for custom applications in GNOME
|
||||
|
||||
This section describes how to enable a keyboard shortcut for starting a custom application in GNOME.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue