Files
overextended.github.io/assets/js/e836e7f0.7389cf86.js
T

1 line
7.3 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[336],{9613:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return p}});var r=n(9496);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),d=c(n),p=o,h=d["".concat(l,".").concat(p)]||d[p]||m[p]||a;return n?r.createElement(h,s(s({ref:t},u),{},{components:n})):r.createElement(h,s({ref:t},u))}));function p(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,s=new Array(a);s[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:o,s[1]=i;for(var c=2;c<a;c++)s[c]=n[c];return r.createElement.apply(null,s)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},3157:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return l},default:function(){return p},frontMatter:function(){return i},metadata:function(){return c},toc:function(){return m}});var r=n(5443),o=n(3010),a=(n(9496),n(9613)),s=["components"],i={},l="Common Issues",c={unversionedId:"oxmysql/Getting Started/issues",id:"oxmysql/Getting Started/issues",title:"Common Issues",description:"Unable to establish a connection",source:"@site/docs/oxmysql/Getting Started/issues.md",sourceDirName:"oxmysql/Getting Started",slug:"/oxmysql/Getting Started/issues",permalink:"/docs/oxmysql/Getting Started/issues",draft:!1,editUrl:"https://github.com/overextended/overextended.github.io/tree/main/docs/oxmysql/Getting Started/issues.md",tags:[],version:"current",lastUpdatedAt:1656531847,formattedLastUpdatedAt:"6/29/2022",frontMatter:{},sidebar:"oxmysql",previous:{title:"Benchmark",permalink:"/docs/oxmysql/Getting Started/benchmark"},next:{title:"Placeholders",permalink:"/docs/oxmysql/Getting Started/placeholders"}},u={},m=[{value:"Unable to establish a connection",id:"unable-to-establish-a-connection",level:3},{value:"No such export ... in resource oxmysql",id:"no-such-export--in-resource-oxmysql",level:3},{value:"Numbers treated as string",id:"numbers-treated-as-string",level:3}],d={toc:m};function p(e){var t=e.components,n=(0,o.Z)(e,s);return(0,a.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"common-issues"},"Common Issues"),(0,a.kt)("h3",{id:"unable-to-establish-a-connection"},"Unable to establish a connection"),(0,a.kt)("p",null,"This is usually the result of incorrect database settings or your password containing reserved characters (",(0,a.kt)("inlineCode",{parentName:"p"},"; , / ? : @ & = + $ #"),")."),(0,a.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,a.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"Solution")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"Ensure you have entered the correct database settings in the mysql_connection_string convar.",(0,a.kt)("br",{parentName:"p"}),"\n","You can try using the semicolon-separated format if your password contains reserved characters."))),(0,a.kt)("h3",{id:"no-such-export--in-resource-oxmysql"},"No such export ... in resource oxmysql"),(0,a.kt)("p",null,"Typically the result of failing to follow instructions."),(0,a.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,a.kt)("div",{parentName:"div",className:"admonition-heading"},(0,a.kt)("h5",{parentName:"div"},(0,a.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,a.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,a.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"Solution")),(0,a.kt)("div",{parentName:"div",className:"admonition-content"},(0,a.kt)("p",{parentName:"div"},"Download the latest release ",(0,a.kt)("em",{parentName:"p"},"build")," (not source) of oxmysql, and ensure it is starting before any resources that require it."))),(0,a.kt)("h3",{id:"numbers-treated-as-string"},"Numbers treated as string"),(0,a.kt)("p",null,"This is an incompatibility between mysqljs (used by mysql-async) and mysql2 (used by oxmysql) (See ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sidorares/node-mysql2/tree/master/documentation#known-incompatibilities-with-node-mysql"},"Known incompatibilities with node-mysql"),")"),(0,a.kt)("p",null,"To resolve this issue simply add ",(0,a.kt)("inlineCode",{parentName:"p"},"&decimalNumbers=true")," to the connection string, ie. ",(0,a.kt)("inlineCode",{parentName:"p"},"mysql://root@localhost/essentialmode?charset=utf8mb4_general_ci&decimalNumbers=true")," to revert to the behavior of mysqljs."),(0,a.kt)("p",null,"Do note with this that precision will be less with this, as Javascript treats all numbers as floats, so a double or decimal will be cast to a float this way."))}p.isMDXComponent=!0}}]);